Simulaten käyttöesimerkki tulkissa


GNU Prolog 1.0.0
By Daniel Diaz
Copyright (C) 1999 Daniel Diaz
| ?- ['/home/ai/mines/simulate'].
compiling /home/ai/mines/simulate.pl for byte code...
/home/ai/mines/simulate.pl compiled, 177 lines read - 12860 bytes written, 740 ms
 
(99 ms) yes
| ?- [agent].
compiling /home/eleinion/prolog/agent.pl for byte code...
/home/eleinion/prolog/agent.pl compiled, 4 lines read - 338 bytes written, 445 ms
warning: /home/eleinion/prolog/agent.pl:4: redefining procedure agent/2
         /home/ai/mines/simulate.pl:27: previous definition
 
(7 ms) yes
| ?- simulator_read_problem('/home/ai/mines/minefield1',X,Y).
 
X = 3
Y = 6 ?
 
(6 ms) yes
| ?- simulator_simulate(3,6,Actions),simulator_score(Actions,Score).
 
Actions = [try(4,6),try(5,6),mark(6,6)]
Score = -8 ?