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 array, base (==3.*), containers, haskell98, wx (>=0.11), wxcore (>=0.11) [details]
License GPL
Copyright (c) 2009 Pedro Vasconcelos
Author Pedro Vasconcelos <>
Maintainer Pedro Vasconcelos <>
Category Game
Uploaded Mon Feb 15 19:21:08 UTC 2010 by PedroVasconcelos
Distributions NixOS:0.3
Downloads 1163 total (16 in the last 30 days)
0 []
Status Docs not available [build log]
All reported builds failed as of 2016-12-30 [all 7 reports]
Hackage Matrix CI


Maintainer's Corner

For package maintainers and hackage trustees

Readme for babylon

Readme for babylon-0.2


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