Prolog input

Basic input
The easiest methods for reading from standard input are reading prolog terms, read(Term), or or single characters, get(Char).

When reading a term the user must end their input with a period and hit return before the read can take place.

When reading single characters the user must hit return before the read can take place.

The set of built-in input functions for standard input include:
read(Term), get(Char), get0(Char)

If you know the right kind of data is going to be entered, you can also use
read_number(N), read_integer(I), read_atom(A)
but these crash if inappropriate data is entered.

If the user enters a text string (in double quotes) it will be stored as a list of ascii codes, while if they enter it in single quotes it will be stored as an atom.

If the term is supposed to be a text string then the user must place it in single quotes and then a period, e.g. 'This is my input!'.

When doing character input, you can also use unget_char(C), unget_code(C) to put things back into the input buffer.