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

  1. /* Program 40 */
  2.  
  3. domains
  4.     list=integer*
  5.  
  6. predicates
  7.     spotlight(integer,integer,integer)
  8.     xy(list)
  9.     undo
  10.  
  11. goal
  12.     graphics(2,0,1),
  13.     makewindow(1,7,7,"First",1,1,18,70),
  14.     xy([0,0,0,6000,4000,20500,20000,24000,16100,1000]),
  15.     xy([0,0,0,9000,3000,26500,20100,24400,20100,1000]),
  16.     makewindow(2,7,7,"Second",10,20,14,60),
  17.     xy([0,1000,0,9000,0,20000,15000,20000,15000,1000]),
  18.     makewindow(3,7,7,"Text",15,0,6,35),
  19.     write(""),nl,
  20.     write("Turbo Prolog windows & graphics."),
  21.     undo,undo,undo.
  22.  
  23. clauses
  24.     xy([X,Y|Rest]):-
  25.         spotlight(15,X,Y),!,xy(Rest).
  26.     xy(_).
  27.  
  28.     spotlight(0,_,_):-!.
  29.     spotlight(N,R,C):-
  30.         X=N*1200,line(R,C,9000,X,1),N1=N-1,
  31.         spotlight(N1,R,C).
  32.  
  33.     undo:-
  34.         write("\n\nPress the space bar"),
  35.         readchar(_),removewindow.
  36.