Advertisement
Guest User

Untitled

a guest
Jan 21st, 2020
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.71 KB | None | 0 0
  1. %repeat, write("hey").
  2.  
  3. %consult(peter).
  4.  
  5. start:- repeat,
  6. writeln('G u e s s a W o r d'),
  7. writeln('----------------------'),
  8. writeln('r - read database file'),
  9. writeln('l'),
  10. writeln('a'),
  11. writeln('d'),
  12. writeln('w'),
  13. writeln('g'),
  14. writeln('e'),
  15. get_single_char(X),
  16. char_code(Y,X),
  17. write('Command: '),
  18. writeln(Y),
  19. read_file(Y),
  20. list(Y),
  21. add(Y),
  22. list(Y),
  23. del(Y),
  24. write_file(Y),
  25. guess(Y),
  26. Y='e'.
  27.  
  28. :- start.
  29.  
  30. read_file(Y):- Y='r'.
  31. list(Y):- Y='l'.
  32. add(Y):- Y='a'.
  33. del(Y):- Y='d'.
  34. write_file(Y):- Y='w'.
  35. guess(Y):- Y='g', .
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement