โ† All Picat Flashcard Decks

Picat String and I/O Operations Flashcards

6 cards from real Picat practice questions. Tap to flip, then mark Knew It or Still Learning โ€” missed cards come back until you master them.

Read the first 6 Picat String and I/O Operations flashcards as text
  1. Which built-in type-checks whether a term is a string in Picat?

    Answer: string(T)

    `string(T)` succeeds if and only if T is a string value in Picat.

  2. What does `atom_chars(Atom, Chars)` accomplish in Picat?

    Answer: Converts between an atom and its character list

    `atom_chars/2` is a bidirectional predicate that converts between an atom and its list of character atoms.

  3. How do you access the Nth element of a string in Picat?

    Answer: S[N]

    Picat supports array-style indexing with `S[N]` to retrieve the Nth element of a string or list.

  4. How do you write formatted output to a specific file stream in Picat?

    Answer: format(Stream, Format, Args)

    `format(Stream, Format, Args)` writes formatted output directed to the specified stream.

  5. What does `number_codes(N, Codes)` do in Picat?

    Answer: Converts between a number and its list of ASCII codes

    `number_codes/2` is a bidirectional predicate converting between a number and its list of character codes.

  6. Which predicate reads a single character from an open stream in Picat?

    Answer: get_char(Stream, Char)

    `get_char(Stream, Char)` reads one character from the stream and unifies Char with the character atom.