home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 9 / 09.iso / l / l210 / 1.ddi / REFEXAMP.ARC / SOUND2.PRO < prev    next >
Encoding:
Text File  |  1988-06-21  |  865 b   |  25 lines

  1. %====================== sound/2               ===============================
  2. /* This program demonstrates the use of the built-in predicate sound. */
  3.  
  4. PREDICATES
  5.    tune(char)
  6.  
  7. CLAUSES
  8.    tune('e') :- !, sound(100, 165).
  9.    tune('a') :- !, sound(100, 220).
  10.    tune('d') :- !, sound(100, 294).
  11.    tune('g') :- !, sound(100, 392).
  12.    tune('b') :- !, sound(100, 494).
  13.    tune('h') :- !, sound(100, 660).
  14.    tune(_) :-
  15.       clearwindow,
  16.       write("That's not a note I can tune to!\n\n","Press any key to continue."),
  17.       readchar(_), clearwindow, fail.
  18. GOAL
  19.    makewindow(1, 7, 7, " GUITAR TUNER ", 0, 0, 25, 80),
  20.    write("Here's a a program to help you tune your guitar.\n\n"),
  21.    write("Please enter the note that you wish to tune"," (e, a, d, g, b, or h for high e): "),
  22.    readchar(Tune),
  23.    upper_lower(Tune, Tune1),
  24.    tune(Tune1).
  25.