Created
August 13, 2013 21:18
-
-
Save chribben/6225801 to your computer and use it in GitHub Desktop.
Tetris Brick Generator
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
import Random | |
data Brick = Line | LeftSquiggle | RightSquiggle | LeftStick | RightStick | Square | |
rand a = Random.range 0 6 (constant a) | |
brick n = if | n == 0 -> Line | |
| n == 2 -> LeftSquiggle | |
| n == 3 -> RightSquiggle | |
| n == 4 -> RightStick | |
| n == 5 -> LeftStick | |
| otherwise -> Square | |
main = asText <~ (brick <~ (rand 1)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment