Category : Miscellaneous Language Source Code
Archive   : PROLOG19.ZIP
Filename : CONSOLE.PRO

 
Output of file : CONSOLE.PRO contained in archive : PROLOG19.ZIP
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."\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 ).



  3 Responses to “Category : Miscellaneous Language Source Code
Archive   : PROLOG19.ZIP
Filename : CONSOLE.PRO

  1. Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!

  2. This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.

  3. But one thing that puzzles me is the “mtswslnkmcjklsdlsbdmMICROSOFT” string. There is an article about it here. It is definitely worth a read: http://www.os2museum.com/wp/mtswslnk/