Final Project
FINAL PROJECT
Brainstorming
My original final project idea was a mini portable photobooth, however, I’m pivoting to make a set of automated long distance mahjong table. If you’ve seen an automated mahjong table, it automatically shuffles and forms the walls. My idea is to push this further by making it sync with other tables
Key Components of Mahjong
- Shuffling - Mahjong is played with a set of 136 tiles that is shuffled and stacked into 4 walls each 17 tiles longs and stacked 2 tiles high.
- Dealing - a player will roll a pair of dice and starting with themselves, count counter-clockwise around the table. The player the count lands on should count the dice roll number from the right side of their wall and break the wall at that point. Then, they take 4 tiles (2 stacks of 2 tiles) after that broken point. Then the players takes turns (counter-clockwise) grabbing 4 tiles (dismantling the wall clockwise).
Algorithmically, given the initial shuffled state, dealing the hands is deterministic. If the dice roll was n:
- Player 1 gets 14 tiles: [2n+0, 2n+3], [2n+16, 2n+19], [2n+32, 2n+35], 2n+48, 2n+52
- Player 2-4 gets 13 tiles (p = player number): [2n + 4(p-1), 2n + 4p - 1], [2n + 4(p-1) + 16, 2n + 4p + 15], [2n + 4(p-1) + 32, 2n + 4p + 31], 2n + 48 + (p-1)
Translating the Key Components Into My Project
- Shuffling - shuffling is typically done by simply mixing the tiles around, but if I’m creating a system of 4 synced tables that are playing the same game, the walls in each table must be the same order after shuffling. In order to sync the tables, the shuffling should be performed digitally and stored as a part of the game state.
- Dealing - Since dealing is deterministic, once the user’s hands are determined, we only have to dispense the assigned tiles for that 1 player that is at the table. For my project, this translates to a tile organizing mechanism which requires identifying and categorizing the tiles into a bucket for each tile type.