## Behemot Prolog - Examples

If you want to load a prolog file that is in you "library/prolog" directory, you must:

1) Execute command "Action|Prolog". Now you should see the Prolog console.
2) Write your query. (Remember: all the query start with the symbol '?-'). If you want to load the file 'exmp.pro' you must type '?-consult(exmp).'. The press the button 'Enter'. If you see 'ok', you have loaded the file. Don' t forget the dot at the end of the line!
3) Execute the predicate which start the program. It may be different by program to program. It may be like '?-start.'.

All the prolog program are text files so you can write your own or modify the examples using a text editor.

### QUEENS.PRO

This is a general prolog program, not specific to Behemot Graphic Editor. It solve the eight[??] queens problem.
To load program: '?-consult(queens).'
To start program: '?-start.'

### ARRAY.PRO

This program allow you to duplicate more times an object along a line. To load program: '?-consult(array).'
To start program: '?-dline(obj1,10,15).'
This will duplicate the object obj1 for 15 times and each object is distance 10 units from the next.

### CIRCLE.PRO

This program allow you to duplicate more times an object along a circle. To load program: '?-consult(circle).'
To start program: '?-dcircle(obj2,20,15).'
This will duplicate the object obj2 for 15 times and each object will be on a circle with radius of 20 units.

### CREATERND.PRO

Show you the use of the rtutils.pro rules.
This program generate 50 random spheres with random colors.
To load program: '?-consult(creaternd).'
To start program: '?-creaternd.'