home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Simtel MSDOS 1992 December
/
simtel1292_SIMTEL_1292_Walnut_Creek.iso
/
msdos
/
prolog
/
prolog19.arc
/
CONSOLE.PRO
< prev
next >
Wrap
Text File
|
1986-05-05
|
640b
|
19 lines
get_answer( A ) :-
ratom( X ), name( X, String ),
valid_resp( String, A ), !.
valid_resp( [H|T], A ) :- type_ans( H, A ).
type_ans( X, A ) :- ([X] = "y"; [X] = "Y"), A = yes.
type_ans( X, A ) :- ([X] = "n"; [X] = "N"), A = no.
type_ans( X, A ) :- ([X] = "w"; [X] = "W"), A = why.
?-print('\nYou can start animal by typing "help.<CR>"\n' ).
valid_resp( [], A ) :-
print('\nPlease try to give me a yes or no answer.'),
get_answer( A ), !.
valid_resp( [H|T], A ) :- valid_resp( T, A ).