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.

56 lines
1.5 KiB

9 years ago
  1. module PowerPhrases where
  2. import Data.Maybe
  3. import VM
  4. import Datatypes.Game (Command(..))
  5. charToCommand :: Char -> Maybe Command
  6. charToCommand 'p' = Just MoveW
  7. charToCommand '\'' = Just MoveW
  8. charToCommand '!' = Just MoveW
  9. charToCommand '.' = Just MoveW
  10. charToCommand '0' = Just MoveW
  11. charToCommand '3' = Just MoveW
  12. charToCommand 'b' = Just MoveE
  13. charToCommand 'c' = Just MoveE
  14. charToCommand 'e' = Just MoveE
  15. charToCommand 'f' = Just MoveE
  16. charToCommand 'y' = Just MoveE
  17. charToCommand '2' = Just MoveE
  18. charToCommand 'a' = Just MoveSW
  19. charToCommand 'g' = Just MoveSW
  20. charToCommand 'h' = Just MoveSW
  21. charToCommand 'i' = Just MoveSW
  22. charToCommand 'j' = Just MoveSW
  23. charToCommand '4' = Just MoveSW
  24. charToCommand 'l' = Just MoveSE
  25. charToCommand 'm' = Just MoveSE
  26. charToCommand 'n' = Just MoveSE
  27. charToCommand 'o' = Just MoveSE
  28. charToCommand ' ' = Just MoveSE
  29. charToCommand '5' = Just MoveSE
  30. charToCommand 'd' = Just RotateClockwise
  31. charToCommand 'q' = Just RotateClockwise
  32. charToCommand 'r' = Just RotateClockwise
  33. charToCommand 'v' = Just RotateClockwise
  34. charToCommand 'z' = Just RotateClockwise
  35. charToCommand '1' = Just RotateClockwise
  36. charToCommand 'k' = Just RotateCounterclockwise
  37. charToCommand 's' = Just RotateCounterclockwise
  38. charToCommand 't' = Just RotateCounterclockwise
  39. charToCommand 'u' = Just RotateCounterclockwise
  40. charToCommand 'w' = Just RotateCounterclockwise
  41. charToCommand 'x' = Just RotateCounterclockwise
  42. charToCommand '\t' = Nothing
  43. charToCommand '\n' = Nothing
  44. charToCommand '\r' = Nothing