The babylon package

[Tags:gpl, program]

The board game was originally designed by Bruno Faidutti ( In this implementation you play against the computer.

[Skip to Readme]


Versions 0.1, 0.2, 0.3
Dependencies base (==3.*), containers, haskell98, wx (>=0.11), wxcore (>=0.11) [details]
License GPL
Copyright (c) 2009 Pedro Vasconcelos
Author Pedro Vasconcelos <>
Maintainer none
Category Game
Uploaded Thu Jun 4 17:10:50 UTC 2009 by PedroVasconcelos
Distributions NixOS:0.3
Downloads 1132 total (15 in the last 30 days)
0 []
Status Docs not available [build log]
All reported builds failed as of 2017-01-01 [all 7 reports]


Maintainer's Corner

For package maintainers and hackage trustees

Readme for babylon

Readme for babylon-0.1


This is an implementation of a simple two-player game
in Haskell using the wxWidgets GUI toolkit.
This program allows you to play against the computer plays using
the classical minimax algorithm with alpha-beta prunning
(based on Bird and Wadler's presentation in the "Introduction
to Functional Programming").

The rules of the game are very simple: 
* there are 12 stone tablets in 4 colors (3 of each color)
* initially the stones are randomly placed on the table,
  forming twelve 1-stone piles
* on his/her turn, a player moves one pile ontop of another
  provided that they have the same height or the same top 
  color (or both)
* the first player who cannot perform a move loses the game.

The game play very fast, typically under 5 mins; since there
are only 12 piles at the start, and each turn decrements one 
pile, the game must finish in at most 11 moves.

Note that there is a winning strategy for the second player, but
it does not appear to be a simple heuristic for it (?). 
The computer will play the winning strategy at the hardest level, 
so it will always win as a second player at this level.

This was basically programmed in a single day as an experiment 
using this wxWidgets (though I was experienced with Haskell). 
I thought it would be a nice addition to show a simple but real
Haskell program.

If you have any comments please drop me a line,

Pedro Vasconcelos
Department of Computer Science
Faculty of Science, University of Porto, Portugal