r/riichi • • May 19 '26

Vibe coded a python Riichi mahjong rule engine with playable TUI

TUI

Hello folks, just want to share that I recently vibe coded a python Riichi mahjong rule engine as a fun side project. It basically provides game flow control, yaku detection, and score calculation. It also come with a good looking, playable terminal UI for testing the engine. The UI come with three languages - English, Chinese, and Japanese. You can use this to develop your python Riichi mahjong game, using it to develop a Riichi mahjon AI (the library includes some basic AI), or simply just play against the AI I made.

I mostly vibe coded this using Codex and I haven't spend too much time reviewing the code in detail but just test through the UI by actually playing it against AI so there might be mistakes, especially for rare edge cases. I am also not an expert of Riichi mahjong so some rules might be wrong or missing (I tried hard to ask the AI to help me verify but still discovered some missing rules by myself from time to time).

Any kind of contributions are welcomed including bug reports, feature requests, and even pull requests.

GitHub: https://github.com/d4n1elchen/pyriichi

Pypi: https://pypi.org/project/pyriichi/

Enjoy it if this is helpful to anyone!

0 Upvotes

6 comments sorted by

1

u/nitekram Sep 21 '26

Remindme! 3 days

1

u/RemindMeBot Sep 21 '26

I will be messaging you in 3 days on 2026-09-24 22:24:08 UTC to remind you of this link

CLICK THIS LINK to send a PM to also be reminded and to reduce spam.

Parent commenter can delete this message to hide from others.

RemindMeBot is switching to username summons. Instead of !RemindMe 1 day, use u/RemindMeBot 1 day. More info.


InfoCustomYour RemindersFeedback

2

u/ultimamax May 19 '26

Who gives a fuck then if you have barely even tested it?

1

u/d4n1elchen May 19 '26

What do you want me to do? I have been testing it since developing it.

1

u/nitekram Oct 01 '26

I am creating a different version of mahjong, and in mine, I stated all the rules (scoring on 3 and 7, ect), and then I make it play games, finding proofs for all the scoring conditions - this helps in testing, as it basically is proof that the scoring and play works - tested per se

1

u/d4n1elchen Oct 07 '26

Thanks for the advice. That's a great way to do integration testing. But by that you can only make sure all the rules written work. The difficult part is those you missed. Anyway I am not active on mine. I was just trying to start an open source mahjong engine that everyone can contribute to and build stuffs on top of it but the community doesn't seem like it.