Langton's ant: Difference between revisions
Content added Content deleted
Line 2,671: | Line 2,671: | ||
=={{header|Prolog}}== |
=={{header|Prolog}}== |
||
This sort of problem, when stated in Prolog, reads a bit like a story book. Our main goal (go) succeeds if we can move north from the middle of the 100x100 matrix, and update_win- which outputs the black/1 blocks. The move/3 and direction/3 goals are really self explanatory. |
This sort of problem, when stated in Prolog, reads a bit like a story book. Our main goal (go) succeeds if we can move north from the middle of the 100x100 matrix, and update_win- which outputs the black/1 blocks. The move/3 and direction/3 goals are really self explanatory. |
||
[[File:ant.jpg]] |
|||
<lang prolog>%_______________________________________________________________ |
<lang prolog>%_______________________________________________________________ |
||
% Langtons ant. |
% Langtons ant. |