Mah-Jong for Unix (and Windows)

News About Requirements Subscribe Getting Using

News

2007-05-22: Version 1.8 has a few minor bug fixes and enhancements, and should have somewhat stronger artificial players.

2006-01-22: Version 1.7 fixes a couple of bugs with rare limit hands, one or two other bugs, and a number of buffer overflow exposures. More importantly for Windows users, the Windows binary distribution is built with up-to-date toolchains and libraries. So far, this appears to solve the mysterious Windows (especially XP) crashes.
Note that a new version gtkdlls1.zip of the GTK+ libraries is needed for this release.

What is it?

This is a set of three programs which provide a networked Mah Jong program, together with a computer player. Thus the game can be played by four humans, by a human and three computer players, or any other combination. There is a server program, which handles the game - only one game, since I'm not trying to compete with Yahoo! and friends -, an X client to allow humans to play naturally, and a computer player. The version of Mah Jong is that generally called Chinese Classical. Of course, there are many variants within this; I intend to accommodate most of the more interesting variants via options, but this is future work. In the longer term, I might also be interested in adding Hong Kong and Japanese versions. I'm not interested in adding American versions, though somebody else might be.

Other online games

The site mahjonged.com collects a number of computer versions, both of mah-jong and the solitaire game using mah-jong tiles - including a link to a Java-based network game. It also has various bits of useful information about the game. (Sponsored link.)

In real life, mah-jong is mostly a gambling game. I'm not aware of online casinos that offer mah-jong, but there are of course many places where other games of skill can be played for money, as well as just for fun. The site CasinoGuide.com provides lists and reviews of Internet sites for, amongst others, online blackjack, online backgammon and, of course, internet poker, not to mention hundreds of casino games like online slots, video poker, pai gow and so on.At most sites you can play either for real money or fun money, as you wish. (Sponsored links, but I've used the site, and it's nicely designed and contentful, with information about the games as well as the casinos and sites. - jcb.)

Books on Mah-Jong

The best book for use with this program is A. D. Millington's Complete Book of Mah-Jong; this is now considered the standard reference for the classical Chinese game, and my program uses Millington's rules. It's published in Britain, and not generally available in the U.S., but you can find it at Amazon UK by clicking on the title. (If you think you will buy this book, please click on that title and add it to your shopping basket - you can always remove it later. Amazon give me 15% commission that way, but only 5% if you first browse or search.)

Screenshots

There's a bunch of screenshots in the directory screenshots. Each is a gif of about 40kB.

System requirements

The programs should compile and run on any reasonably modern Unix system. (This is known to include GNU/Linux, Solaris and Irix.) They also work on 32-bit Windows systems.

You need version 1.2 of the GTK+ libraries (and of course headers in order to build from source) - on Windows, at least version 1.3 release of 2004-03-15; for further information, see the latest README file.

To build the programs from source, you also need Perl, and preferably GNU make; on Windows you will need various Microsoft files which are part of the Platform SDK (which is fortunately available free of charge from their Web site); and it will be easier to build with gcc, although possible with Visual C.

To decide whether you want to upgrade, read the brief notes of the differences between successive releases in the CHANGES file.

Subscribe to release information

I no longer maintain the Freshmeat record for this project. If you wish to receive notifications of new releases, and perhaps occasional similar announcements or requests for information, please subscribe using this form. Naturally, your email address will be used for this purpose only.

Email address:

Please type the characters "ken3ding4" (without the quotes) in this box:
(just to stop dumb automatic subscriptions).

Source code

Source code (current and old versions, and patches where appropriate), in the form of gzipped tar file, can be found in the Source directory.

Linux binaries

The "mj-linux-i386" binary distribution was compiled under a Linux 2.4 kernel, GNU utilities and libraries, GNU glibc-2.2.5 (aka libc-6), XFree86-4, GTK+ 1.2. Of these, only the libc and GTK versions are likely to matter.

The normal Linux binaries are in the Linux directory.

The "static-mj-linux-i386" distribution has the GTK+ libraries compiled in; get this only if you don't already have GTK+ installed.

The statically linked Linux binaries are in the LinuxStatic directory.

Statically linked binaries are no longer provided; the last version available is 1.6.3.

For Debian users: xmj is part of Debian, as package called mahjong, maintained by Nicolas Boullis.

Windows executables

The "mj-win32-i386" distribution was compiled under Windows NT 4.0, with the mingw port of GCC (MinGW version 3.1), and GTK+ for Win32 version 1.3 release of 2004-03-15. These binaries should in theory run on any Win32 system (except old systems lacking MSVCRT.DLL); they have been successfully run on a Windows 95 system, as well as the system on which they were built.

The binaries are in the Windows directory.
Since the GTK+ dlls are not a standard part of a Windows system, for your convenience I have packed all the necessary libraries into a zip file gtkdlls1.zip (1.8MB) which you will also find in the Windows directory.
NOTE that this is a different set of libraries from that used by previous versions.

Using the programs

The user documentation comes in two parts (also available combined into a man page): use.txt is the basic documentation, and rules.txt describes the rules of the game as implemented.

Making a donation

Do you enjoy using this program? Would you like to help me improve my Mah-Jong book collection, buy me a virtual drink, or whatever?

You can make a donation via PayPal. The amount is up to you; if you want a suggested figure, how about fifteen euros/dollars?


Julian Bradfield
Last modified: Tue Aug 19 22:06:26 BST 2008