Project Showcase: Mahjong calculator
Posted: 14 October 2016, 13:04 PM
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
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