Advertisement
starbeamrainbowlabs

Lab4.Month.pl

Oct 27th, 2015
285
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Prolog 0.50 KB | None | 0 0
  1. month(1) :-
  2.     write('January').
  3. month(2) :-
  4.     write('February').
  5. month(3) :-
  6.     write('March').
  7. month(4) :-
  8.     write('April').
  9. month(5) :-
  10.     write('May').
  11. month(6) :-
  12.     write('June').
  13. month(7) :-
  14.     write('July').
  15. month(8) :-
  16.     write('August').
  17. month(9) :-
  18.     write('September').
  19. month(10) :-
  20.     write('October').
  21. month(11) :-
  22.     write('November').
  23. month(12) :-
  24.     write('December').
  25. month(_) :-
  26.     write('Invalid month code.').
  27.  
  28. go :-
  29.     write('Enter month code: '),
  30.     read(MonthCode),
  31.     month(MonthCode).
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement