tags:

views:

43

answers:

2

How do i read in char type by users if they are a- , b+ , o+ ? I don't seem to have problem reading in char like a , b , c or d. i am using read(X) . Can someone help me out with this ? Thanks in advance.

A: 

As I remember read/1 reads the term. If you want to read characters you may consider get_char/1 or something like that

?- get_char(X),get_char(Y).
|: a-

X = a,
Y = (-).
ony
+1  A: 

I managed to solve the problem using read_string() . :)

Then maybe you should accept your own answer so that this question is marked as solved.
ShiDoiSi