home *** CD-ROM | disk | FTP | other *** search
/ Programmer Plus 2007 / Programmer-Plus-2007.iso / Programming / Borland Plateform / Turbo Prolog 2 / EXAMPL38.PRO < prev    next >
Encoding:
Prolog Source  |  1986-04-23  |  357 b   |  15 lines

  1.               /* Program 38 */
  2. predicates
  3.     square(integer)
  4.     fillsquare(integer)
  5. goal
  6.     graphics(2,1,0),
  7.     fillsquare(5000).
  8. clauses
  9.     square(X):-
  10.         forward(X),right(90),forward(X),right(90),
  11.         forward(X),right(90),forward(X),right(90).
  12.     fillsquare(X):-X>10000,!.
  13.     fillsquare(X):-square(X),Y=X+500,fillsquare(Y).
  14.  
  15.