| CARVIEW |
Select Language
HTTP/1.1 200 OK
Connection: keep-alive
Server: nginx/1.24.0 (Ubuntu)
Content-Type: text/html; charset=utf-8
Cache-Control: public, max-age=300
Content-Encoding: gzip
Via: 1.1 varnish, 1.1 varnish
Accept-Ranges: bytes
Age: 0
Date: Sun, 18 Jan 2026 14:47:24 GMT
X-Served-By: cache-dfw-kdal2120060-DFW, cache-bom-vanm7210082-BOM
X-Cache: MISS, MISS
X-Cache-Hits: 0, 0
X-Timer: S1768747644.917044,VS0,VE292
Vary: Accept, Accept-Encoding
transfer-encoding: chunked
4Blocks: A tetris-like game (works with GHC 6.8.3 and Gtk2hs 0.9.13)
[Skip to Readme]
4Blocks: A tetris-like game (works with GHC 6.8.3 and Gtk2hs 0.9.13)
A tetris-like game implemented in Haskell and making use of Gtkh2s (works with GHC 6.8.3 and Gtk2hs 0.9.13)
[Skip to Readme]
Downloads
- 4Blocks-0.2.tar.gz [browse] (Cabal source package)
- Package description (as included in the package)
Maintainer's Corner
For package maintainers and hackage trustees
Candidates
- No Candidates
| Versions [RSS] | 0.1, 0.2 |
|---|---|
| Dependencies | base (>=2 && <=4), cairo (>=0.9.13), containers (>=0.1.0.2), gtk (>=0.9.13), haskell98, mtl (>=1.1.0.1) [details] |
| Tested with | ghc ==6.8.3 |
| License | BSD-3-Clause |
| Author | Andrew Calleja |
| Maintainer | drewcalleja@gmail.com |
| Uploaded | by AndrewCalleja at 2010-05-07T18:55:25Z |
| Category | Game |
| Home page | https://lambdacolyte.wordpress.com/2009/08/06/tetris-in-haskell/ |
| Distributions | |
| Reverse Dependencies | 1 direct, 0 indirect [details] |
| Executables | 4Blocks |
| Downloads | 3284 total (8 in the last 30 days) |
| Rating | 1.25 (votes: 1) [estimated by Bayesian average] |
| Your Rating |
|
| Status | Docs not available [build log] All reported builds failed as of 2016-10-24 [all 14 reports] |
Readme for 4Blocks-0.2
[back to package description]4Blocks is a tetris-like game implemented in Haskell and Gtk2hs for an AI project.
Some notes:
- The game currently works only with GHC 6.8.3 due to its use of Gtk2hs 0.9.13.
- I haven't tested with anything later but it is likely to fail due the fact that
later versions of Gtk2hs have a different system of handling events.
- To make this project compatible with later versions of GHC and Gtk2hs two changes are required:
- Remove the function "permutations" which was copied from a later GHC base library
- Alter key-event handling to the version used by later Gtk2hs: some functions (in CommandKeys.hs)
were simply introduced in order to disallow some of the keys used in the game (namely rotation) to trigger
continuously when a key is held pressed. I believe this kind of behaviour can be managed automatically
with Gtk2hs' new event handling mechanism, however I haven't had time to recode accordingly myself.
- I hope to write a patch for this in the near future.
To play:
- [1] Starts a Game
- [P] Pause/Resume Game
- [Esc] Exit Game
- [A]/[Left] Shift Left
- [D]/[Right] Shift Right
- [W]/[Up] Hard Drop
- [S]/[Down] Soft Drop
- [Q]/[,] Rotate Left
- [E]/[.] Rotate Right
Some gameplay features to add in the future:
- T-spin points
- Wall-kick
- Sounds!
Finally:
- Feel free to criticize (constructively) my code as this has been my first real forray into Haskell.
- Email me on drewcalleja@gmail.com :)
- Enjoy!