Mahjongg is a very popular board game. The goal is to remove
all tiles from the board two by two, by removing tiles with the same
face that are not blocked by others. A blocked tile is one that is
partially or fully covered on top or has neighbouring tiles to the
left and right.
The game finishes when either all tiles are complete or there are no more moves left.
mkfile -- use this mkfile to compile for plan9 ports (the -c option is mandatory there)
Synopsis: mahjongg [-b background] [-t tileset] [-l layout] [-c]
where background, tileset and layout are Plan 9 images that can be read by readimage(). The tilesets mahjongg can parse are the ones from Kyodai, a windows 3D mahjongg game, there are many tilesets available under the "more downloads" section of their web page. The layouts are from KMahjongg. The -c selects a true-color buffer image, use with drawterm or in case selecting a tile obscures it completely.
Use the mouse button to select tiles (notice how they change color). Selecting two tiles with the same image will remove them from the board. There are four tiles with flowers on them -- they are of the same type. There are four tiles with the four seasons on them -- they are of the same type.
The 'n' key will generate a new level. The 'r' key will restart the current level. 'Q' and Del quit. The 'h' key will give you a hint, either trying to match the currently selected tile, or if no tile is selected finding out the first available tile.
The bricks are not 3D, even though the code is there -- the borders I created are just too ugly.
The code is messy.