|
mammoths-1.1.tar.gz is distributed
under MIT license.
Extract the package and start mammoths.py.
tar xzf mammoths-1.1.tar.gz
cd mammoths-1.1
python mammoths.py
The goal is to move mammoths so that they stamp on every dude in
the game board.
Select a mammoth to be moved by clicking it or by pressing TAB.
Move the selected mammoth by clicking its neighbouring squares
or use keypad.
The mammoth stamps on a dude if there are more mammoths than other
dudes in the dude's neighbouring squares, and if the dude cannot
escape to a square where there are fewer mammoths around.
The mammoth is speared if it is alone, that is, there are no other
mammoths in the surrounding squares, and if there are two or more
dudes next to it.
When all dudes are stamped, you get an extra mammoth and move to
the next level. New levels have three dudes more than their
predecessors.
The game ends when your mammoths are dead or when the rest of the
dudes have found positions where they cannot be stamped on (in the
latter case you have to press Q to quit). Your score is the number of
stamped dudes.
When you move to the next level or press 'Q' (for Quit) or when you
have just lost all your mammoths, the game prints out "your game" that
far. The game is presented as space separated base-89 numbers. The
first number is the seed of the random number generator. Moves on each
level are encoded to the following numbers. The game can be reproduced
and continued (if you still have living mammoths) when you give the
numbers as the first command line parameter. Single quotes around the
numbers seem to work in many Unix shells.
For example, try
python mammoths.py '6<8UK1 cL;^)-]qtnV@3k}_.!5w/RS:5Ws ^;L(x#gta8Cq(3?RexsCU/vg7VYHF!l1KJ'
I got 54 points. (Follow the link
to so you can be sure I'm not cheating.)
If someone sets up a highscore server that accepts "your games",
I'll promise to link it here. Do not send me your scores, please.
I had heard about Pygame library and wanted to get a hands-on
feeling on it. Then one day, my three-year old son said he wanted to
play a computer game with mammoths on it. So when he went on his
afternoon nap, I started looking for Pygame tutorials, writing some
code and drawing images. The game was already playable when he woke
up. Getting to know Pygame and using it for a simple game like this
turned out to be surprisingly easy. Unfortunately, my son would not
like the game. "It's boring", he said. Well, I can't blame Pygame on
that.
Later on, I added encoding and decoding of moves and tuned the
rules a bit. I did not try to trick my son to play the game anymore,
though. Instead, I decided to put it on the web. You never know if it
will be found by someone who likes boring games.
The disclaimer part: the code is written very quickly indeed. If
you would like to try Pygame, you should look for a decent tutorial
and ignore this code. It's a bit of a mess.
|