Mercurial > repos > icfp2014
annotate code/simple.lm @ 73:91e7a30a9e27
Unsuccessful attempt at improving ghost performance with a wingman ghost
author | Michael Pavone <pavone@retrodev.com> |
---|---|
date | Mon, 28 Jul 2014 00:42:45 -0700 |
parents | 84f595cff062 |
children |
rev | line source |
---|---|
11
2a74559e07f5
Added overly simple AI that just moves in each direction in turn for a fixed number of moves
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1 #{ |
2a74559e07f5
Added overly simple AI that just moves in each direction in turn for a fixed number of moves
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
2 counterLoad <- 4 |
2a74559e07f5
Added overly simple AI that just moves in each direction in turn for a fixed number of moves
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
3 step <- :myState world { |
2a74559e07f5
Added overly simple AI that just moves in each direction in turn for a fixed number of moves
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
4 move <- myState value |
2a74559e07f5
Added overly simple AI that just moves in each direction in turn for a fixed number of moves
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
5 counter <- (myState tail) - 1 |
2a74559e07f5
Added overly simple AI that just moves in each direction in turn for a fixed number of moves
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
6 if: counter = 0 { |
2a74559e07f5
Added overly simple AI that just moves in each direction in turn for a fixed number of moves
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
7 move <- move + 1 |
2a74559e07f5
Added overly simple AI that just moves in each direction in turn for a fixed number of moves
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
8 counter <- counterLoad |
2a74559e07f5
Added overly simple AI that just moves in each direction in turn for a fixed number of moves
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
9 if: move = 4 { |
2a74559e07f5
Added overly simple AI that just moves in each direction in turn for a fixed number of moves
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
10 move <- 0 |
2a74559e07f5
Added overly simple AI that just moves in each direction in turn for a fixed number of moves
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
11 } else: {} |
2a74559e07f5
Added overly simple AI that just moves in each direction in turn for a fixed number of moves
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
12 } else: {} |
2a74559e07f5
Added overly simple AI that just moves in each direction in turn for a fixed number of moves
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
13 #[#[move counter] move] |
2a74559e07f5
Added overly simple AI that just moves in each direction in turn for a fixed number of moves
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
14 } |
2a74559e07f5
Added overly simple AI that just moves in each direction in turn for a fixed number of moves
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
15 |
2a74559e07f5
Added overly simple AI that just moves in each direction in turn for a fixed number of moves
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
16 main <- :initWorld mystery { |
19
84f595cff062
Added tree:set:to function
Michael Pavone <pavone@retrodev.com>
parents:
11
diff
changeset
|
17 print: mystery |
11
2a74559e07f5
Added overly simple AI that just moves in each direction in turn for a fixed number of moves
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
18 #[#[0 counterLoad] step] |
2a74559e07f5
Added overly simple AI that just moves in each direction in turn for a fixed number of moves
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
19 } |
2a74559e07f5
Added overly simple AI that just moves in each direction in turn for a fixed number of moves
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
20 } |