[Haskell-cafe] Tetris

Don Stewart dons at galois.com
Mon Nov 19 17:12:39 EST 2007


andrewcoppin:
> If you were going to implement Tetris in Haskell, how would you do it?
> 
> (For that matter, has anybody already *done* it? It would probably make 
> a nice example program...)

http://haskell.org/haskellwiki/Applications_and_libraries/Games

    ASCII tetris
    http://web.comlab.ox.ac.uk/oucl/work/ian.lynagh/Hetris/

OpenGL or Gtk2Hs seem the best options.

> 2. How do you implement a program that is fundamentally about state 
> mutation in a programming language which abhors state mutation?

Its not clear games are fundamentally about mutation, anymore than, say,
window managers are. State we do with monads.

Check the thesis on Frag for a pure approach, or just use StateT IO.

-- Don



More information about the Haskell-Cafe mailing list