1

If I try to input a character of input by calling get_code/1 like this, there is a prompt displayed.

?- get_code(C).
|: a
C = 97.

This works as I would expect, but I want to input characters without drawing the prompt for this specific call (I may want to draw it again later). As of now, I am doing this:

my_get_code(C) :- prompt1(''), get_code(C).

Which works, but is there a better or more proper way to do this?

1 Answers1

0
char_code(Char,Code) . %BuiltIn

?- char_code(a,N).
N = 97 ? ;

or

?- C=0'a.
C = 97 ? 

or tape this

?-C="a".
C = [97] ? ;
no
Ans Piter
  • 573
  • 1
  • 5
  • 17