n.b. -- Lazy here refers to my coding habits, not the evaluation strategy.
It's a quick-and-dirty tetris clone, just what the world needed! Initial version was written in a few hours in order to prove a point in an IRC channel.
* syntaxglitch should put together a simple game in Haskell this weekend,
just for the sake of doing something...
<hpc> there is no such thing as a simple game
<hpc> something will rain on your parade; it is inevitable
<syntaxglitch> only because I keep toying with ways to write less imperative code
<syntaxglitch> I could write something stupidly simple like Tetris in a
couple hours in standard imperative style with a game loop and
some IORefs and whatnot, but where's the fun in that?
* sm is with hpc.. it's true, there is no such thing as a simple
game (in haskell.. currently.. tty-style games excluded..)
As it turned out I spent more like 3-4 hours on it. On the other hand I didn't use any IORef
s and it's actually mostly pure, albeit ugly, code. You win some, you lose some, but the point remains: Writing a stupidly simple game in Haskell isn't, in fact, all that difficult.
Writing a game that doesn't suck is left as an exercise for the reader.
This really is pretty terrible code. Don't assume I endorse anything in particular here, and please don't hold any of it against me!
Since I'm too lazy to have written a .cabal file yet, here're the dependencies:
- SDL http://hackage.haskell.org/package/SDL
- SDL-ttf http://hackage.haskell.org/package/SDL-ttf
- OpenGL http://hackage.haskell.org/package/OpenGL
- graphics-drawingcombinators http://hackage.haskell.org/package/graphics-drawingcombinators
Good luck getting the first three working on non-Linux platforms!