Play the game of Hamurabi with Ansible
Simply count the total number of dead through starvation
Execute molecule on sourcehut


browse  log 



You can also use your local clone with git send-email.

#Ansible Playbook: Hamurabi

This project is an attempt to bring the text-based strategy game Hamurabi to Ansible. I intend to stay close to the BASIC version from David H. Ahl while also incorporating a few niceties to improve user experience.

The goal is to govern the Ancient Sumeria for a duration of 10 years, managing your grain between feeding your people, planting new crops, buying or selling land. Rats can randomly come and eat your stock of grains while plague can decimate your population. Be careful in your calculations!

The game ends if:

  • 10 years passed.
  • 45% of the population died of starvation during one year

A successful play is measured by the ratio of owned land compared to the population: more than seven acres of land per people is a win.

#How to play

The following packages are necessary:

  • ansible

Simply run the following command:

$ ansible-playbook hamurabi.yml


Note: testing requires molecule as an additional dependency.

There is only one testing scenario right now, which tests player actions and their limits such as trying to sell too much land, planting crops without enough seeds, etc.

To run it:

$ molecule converge


Here is a list of features yet to be implemented:

  • Implement a system to provide a seed to improve testing.


Ansible is not exactly a comfortable medium to play video games. Consider yourself warned.




Either send send GitHub pull requests or send patches on SourceHut.

#Author Information

Tristan Le Guern tleguern@bouledef.eu