Mah-Jong for Linux, Unix, MacOS and Windows

News About Requirements Subscribe Getting Using

News

2009-07-10: Version 1.10 converts xmj to use the current GTK+2 toolkit instead of the very old and unsupported GTK+1 toolkit. It also adds a few new features (mostly at the UI level), and fixes a surprising number of rather long-standing bugs. I recommend all users to upgrade. The Windows version is not as pretty as the new Linux version, but now all the features (such as accelerator keys) work in Windows as well as in Linux. (Note that a GTK1 version is still available for Windows, in case you want to run it on an old Windows system where GTK+2 doesn't work.) See the CHANGES for a summary of changes.

This is the end of the line for xmj version 1. There will be no further releases except bug fixes. It's possible that a much improved version 2 will appear one day, but this could be anywhere from a year to a decade away, or never!

2008-08-21: Version 1.9 fixes a lazy bug whereby robot player names could not contain spaces etc. It also implements some additional features for possible future use, hence the new minor release rather than just a patch release.

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.)

There's a new site also about mahjong. mahjong.net says that it aims to build up a clean site that collects together information about the game, whether history, or the various mahjong rules. At present the information is very brief, but hopefully it will expand over time. (Sponsored links.)

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. There also many sites that act as feeders by reviewing and offering discounts, but don't directly play the games.
One such site is pokeranch (in English) and its German versions. They have reviews of internet poker software, such as the popular Everest poker (in German). They also offer a Titan poker bonus (also in German) available at some actual casinos using the also popular Titan software. A page of articles about poker is being developed. (Sponsored links.)
For the Spanish-speaking online casino (or should I say casino en linea) fan, the site DeCasinos.net offers summaries of rules and probabilities of winning for a number of games. It pays particular attention to Playtech software such as Casino Europa and Titan Poker, which were new to me - it's interesting to hear about casino software, as well as just casino sites. (Sponsored link, but I've checked the site out - yes, I do read Spanish! - 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.

For version 1.10 (Linux), you need GTK+2, preferably in a fairly modern version. This should be installed on any Linux distribution less than about eight years old. For the Windows GTK2 build, the required libraries are included in the zip file; but you need Windows 2000 or later. If you are running an older version of Windows, you should probably use the GTK1 build, in which case you will need to install the gtkdlls1.zip file as well.

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 though it is theoretically possible to build in an MS development environment, for all practical purposes you will need MinGW.

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+ 2.6. It should run on practically any Linux i386 system.

The normal Linux binaries are in the Linux directory.

For Debian users: xmj is part of Debian, as package called mahjong.

Windows executables

The mj-win32-i386-gtk[12] distributions were compiled under Windows 2000, with fairly recent MinGW, and GTK+ for Win32 version 1.3 release of 2004-03-15 for -gtk1, and a recent GTK+2 release for -gtk2. The -gtk1 binaries should in theory run on any Win32 system (except old systems lacking MSVCRT.DLL); the -gtk2 binaries need Windows 2000 or later, because GTK+2 does.

The binaries are in the Windows directory.
For the -gtk2 distribution, the necessary DLLs are included in the zip file (which is why it's so large).
For the -gtk1 distribution, you need (if you have not downloaded them before) the libraries in the gtkdlls1.zip (1.8MB) file which you will also find in the Windows directory. The contents of this file should be unpacked into the folder of the mj program.

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: Fri Jan 15 10:13:55 GMT 2010