Skip to content

Instantly share code, notes, and snippets.

@prednaz
Created January 25, 2021 23:06
Show Gist options
  • Save prednaz/bb3e3b44aef25fb862de56e061910c22 to your computer and use it in GitHub Desktop.
Save prednaz/bb3e3b44aef25fb862de56e061910c22 to your computer and use it in GitHub Desktop.
data Tile =
Empty {position :: Position} |
Wall {position :: Position}
data Position =
Position
{
x :: Double,
y :: Double
}
-- position :: Tile -> Position
-- x :: Position -> Double
tiles :: [Tile]
tiles =
[Wall (Position 0 0), Wall (Position 0 1), Wall (Position 0 2)]
tilesFiltered r =
[tile |
tile <- tiles,
(x (position tile) ** 2 + y (position tile) ** 2) ** (1/2) < r
]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment