The popular Mahjong game (4 players using ivory bricks) uses a points reckoning system that balances the individuals' scores in a certain way so that the net result always equals zero. This process is rather tedious and therefore a good candidate for automation. My oldest son and I undertook the project of implementing such a calculator in ZBasic hardware using a ZX328L and a simple matrix keyboard and an LCD display. Attached below are:
1. A picture of the calculator in the game setting
2. The circuit diagram
3. The ZBasic project file
The project is a nice example of the flexibility and power of the ZBasic platform, as shown for example by:
- The use of the FirstTime command to show a welcome text only a few times (a concise and cleaned-up version is shown in http://www.zbasic.net/forum/about1864.html.
- The use of the AN105 code for interfacing the matrix keyboard, providing for a very fluid behavior of the keyboard in practice.
- Object-oriented programming as a useful way to easily include functionality (for example: LCD display routines are used through the mix-in concept).
Posted in support of the continued liveliness of the ZBasic platform & forum ...
Best regards,
Jurjen
Project Showcase: Mahjong calculator
-
- Posts: 57
- Joined: 27 July 2009, 14:20 PM
- Location: Groningen, The Netherlands
- Contact:
Project Showcase: Mahjong calculator
- Attachments
-
- Mahyong points calculator 2.jpg
- The calculator in physical form
- (211.36 KiB) Downloaded 165 times
-
- MahYongCircuit.JPG
- The electronic circuit diagram
- (104.09 KiB) Downloaded 157 times
-
- MahyongCalculator.zip
- The project code
- (7.96 KiB) Downloaded 468 times
-
- Posts: 57
- Joined: 27 July 2009, 14:20 PM
- Location: Groningen, The Netherlands
- Contact:
Re: Project Showcase: Mahjong calculator
And of course it never hurts to finally build it into a nice case: