|
|
@ -5,21 +5,26 @@ import VM |
|
|
|
|
|
|
|
seswlist = cycle [MoveSE, MoveSW] |
|
|
|
|
|
|
|
strat0 :: Game -> [Command] |
|
|
|
strat0 game = take nsteps seswlist |
|
|
|
strat0 :: Game -> ([Command],Int) |
|
|
|
strat0 game = (take nsteps seswlist, score) |
|
|
|
where |
|
|
|
nsteps = stepr game |
|
|
|
(nsteps, score) = stepr game |
|
|
|
|
|
|
|
stepr :: Game -> Int |
|
|
|
stepr :: Game -> (Int,Int) |
|
|
|
stepr game = if notes == Ended |
|
|
|
then 1 |
|
|
|
else 1 + (stepl new_game) |
|
|
|
then (1,score) |
|
|
|
else (1 + (fst new_step), snd new_step) |
|
|
|
where |
|
|
|
(new_game,notes) = step game MoveSE |
|
|
|
score = points new_game |
|
|
|
new_step = (stepl new_game) |
|
|
|
|
|
|
|
stepl :: Game -> Int |
|
|
|
stepl :: Game -> (Int,Int) |
|
|
|
stepl game = if notes == Ended |
|
|
|
then 1 |
|
|
|
else 1 + (stepr new_game) |
|
|
|
then (1,score) |
|
|
|
else (1 + (fst new_step), snd new_step) |
|
|
|
where |
|
|
|
(new_game,notes) = step game MoveSW |
|
|
|
(new_game,notes) = step game MoveSW |
|
|
|
score = points new_game |
|
|
|
new_step = (stepr new_game) |
|
|
|
|