home *** CD-ROM | disk | FTP | other *** search
/ Power-Programmierung / CD1.mdf / prolog / library / prolo_c / exampl42.pro < prev    next >
Text File  |  1986-10-06  |  481b  |  23 lines

  1. /* Program 42 */
  2. /*
  3.   This program simply plays notes up and down
  4.   a scale
  5. */  
  6. domains
  7.     direction=up;down
  8.  
  9. predicates
  10.     jack_and_jill(direction,integer)
  11.  
  12. goal
  13.     jack_and_jill(up,500).
  14.  
  15. clauses
  16.     jack_and_jill(up,F):-
  17.         F<5000,!,sound(1,F),F1=F+200,jack_and_jill(up,F1).
  18.     jack_and_jill(up,F):-
  19.         jack_and_jill(down,F).
  20.     jack_and_jill(down,F):-
  21.         F>500,!,sound(1,F),F1=F-200,jack_and_jill(down,F1).
  22.     jack_and_jill(down,_).
  23.