Home

mlamp

Download project

Mahjongg

Find pairs of symbols, select them and they will be removed. Challenge CODESYS
(CODESYS plays a rather simple strategy, but hard to beat) and see if you remove more tiles.
The game is finished when all pairs of tiles have been removed from the board or when there
are no exposed pairs remaining.

Product description

At the beginning, the game is initialized with a field of 144 tiles with 36 different symbols.
A tile is said to be open or exposed if it can be moved either left or right without disturbing other tiles.
The goal is to match open pairs of identical tiles and remove them from the board, exposing the tiles under
them for play. The game is finished when all pairs of tiles have been removed from the board or when there
are no exposed pairs remaining.

More information

SelectableTile: This function proves if the requirements mentioned above are fulfilled.

SetCursor: This program is responsible for setting the border of the currently selected tile.

PlayMahjongg: The main logic is implemented.

GetNumOfPairs: The number of currently available pairs is calculated.

CoDeSysPlays: CODESYS tries three different strategies and chooses the one resulting in the fewest
remaining tiles.

Visualization: The user can challenge CODESYS to play the game. CODESYS tells the user its best game.
Then the user can try to beat CODESYS.

Image Pool: The images are stored inside the project and can be accessed in the visualization with an ID.

System requirements and restrictions

System requirements and restrictions Info
Programming System CODESYS Development System Version 3.5.14.0 or higher
Runtime System CODESYS Control Version 3.5.14.0
Required Accessories -

Screenshot thumbnail
Screenshot of the game