Skip to content

Instantly share code, notes, and snippets.

@artemohanjanyan
Created April 15, 2022 16:08
Show Gist options
  • Save artemohanjanyan/6a97e6d22c420906d50bb0c83d9ee174 to your computer and use it in GitHub Desktop.
Save artemohanjanyan/6a97e6d22c420906d50bb0c83d9ee174 to your computer and use it in GitHub Desktop.
maze :: Integer -> Integer -> Integer
maze x y
| abs x > 10 || abs y > 10 = 0
| x == 0 && y == 0 = 2
| abs x == 9 && abs y == 9 = 1
| abs x == 10 || abs y == 10 = 1
| x == y = 3
| abs x == abs y = 4
| x < 0 && x > (-9) && y == 0 = 4
| x > 0 && x < 9 && y == 0 = 3
| otherwise = 2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment