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.

55 lines
1.5 KiB

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