Created
June 26, 2014 12:08
-
-
Save lnicola/0f86eb3881a6a9e27844 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| module Main where | |
| import Data.List | |
| expand (x, y) = [(0, y), (x, 0), (v1, y), (x, v2), (x - d1, y + d1), (x + d2, y - d2)] where | |
| d1 = min x (v2 - y) | |
| d2 = min y (v1 - x) | |
| v1 = 17 | |
| v2 = 13 | |
| generate xs len = if newlen == len | |
| then xs | |
| else generate new newlen where | |
| new = nub $ xs ++ concatMap expand xs | |
| newlen = length new | |
| seed x = generate [x] 1 | |
| main = print $ seed (0, 0) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment