You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

25 lines
509 B

  1. module Strategy0 where
  2. import Datatypes
  3. import VM
  4. seswlist = cycle [MoveSE, MoveSW]
  5. strat0 :: Game -> [Command]
  6. strat0 game = take nsteps seswlist
  7. where
  8. nsteps = stepr game
  9. stepr :: Game -> Int
  10. stepr game = if notes == Ended
  11. then 1
  12. else 1 + (stepl new_game)
  13. where
  14. (new_game,notes) = step game MoveSE
  15. stepl :: Game -> Int
  16. stepl game = if notes == Ended
  17. then 1
  18. else 1 + (stepr new_game)
  19. where
  20. (new_game,notes) = step game MoveSW