Mercurial > repos > icfp2014
comparison code/simple.lm @ 11:2a74559e07f5
Added overly simple AI that just moves in each direction in turn for a fixed number of moves
author | Michael Pavone <pavone@retrodev.com> |
---|---|
date | Fri, 25 Jul 2014 15:09:17 -0700 |
parents | |
children | 84f595cff062 |
comparison
equal
deleted
inserted
replaced
10:66d0858692a9 | 11:2a74559e07f5 |
---|---|
1 #{ | |
2 counterLoad <- 4 | |
3 step <- :myState world { | |
4 move <- myState value | |
5 counter <- (myState tail) - 1 | |
6 if: counter = 0 { | |
7 move <- move + 1 | |
8 counter <- counterLoad | |
9 if: move = 4 { | |
10 move <- 0 | |
11 } else: {} | |
12 } else: {} | |
13 #[#[move counter] move] | |
14 } | |
15 | |
16 main <- :initWorld mystery { | |
17 #[#[0 counterLoad] step] | |
18 } | |
19 } |