I Thought Codex Could Build a Mahjong Game If I Just Asked

A quiet Zen-style mahjong table concept for Mahjong Friends Coding Tools
A quiet Zen-style mahjong table concept for Mahjong Friends

I wanted a free mahjong game I could play with friends in a browser.

That was the whole idea.

No app install. No account setup. No ranked ladder. No strangers required. Just open a URL, create a room, share it with friends, and start playing.

When I looked around, that kind of lightweight free-play mahjong experience felt harder to find than I expected. There are plenty of mahjong games, but many of them are tied to apps, accounts, ads, rankings, matchmaking, or a platform-specific flow.

So I had a simple thought:

If AI coding tools are this advanced now, maybe I can ask Codex to build one.

The project became Mahjong Friends.

The goal was not to build a flashy mahjong platform. The goal was to get something that actually feels playable as mahjong.

The First Part Worked

The early progress was encouraging.

With Codex helping, the project became a React and Vite browser game with a Colyseus server for rooms and real-time play. It reached the point where it had a lobby, room codes, a four-seat table, an AI practice mode, tile dealing, discards, riichi, ron, tsumo, and yaku display.

It also reached a point where I could publish it on GitHub Pages:

Open the current Mahjong Friends build

The visual direction became a quiet Zen-style table rather than a noisy arcade screen. I wanted the table and tiles to be the main event.

A calm room-style table visual for Mahjong Friends
A calm room-style table visual for Mahjong Friends

For a while, it looked like the simple version of the story was true:

AI is powerful. Ask it for a game, and it can help you build one.

But the project did not stay simple for long.

Mahjong Is Much Harder Than It Looks

I did not want an ambitious game at first.

I did not need rankings, avatars, cosmetics, monetization, or a full social platform.

I only wanted something that could be played as mahjong.

That sentence hides a lot.

Dealing tiles is one problem. Discarding tiles is another. Taking turns is manageable. But then the real game begins:

  • When is ron legal?
  • When is tsumo legal?
  • What exactly makes riichi available?
  • How should the one-yaku requirement work?
  • Which yaku should be implemented first?
  • How should calls such as chi, pon, and kan work?
  • How should furiten be handled?
  • How exact does scoring need to be before the game feels trustworthy?

And rules are only half of it.

The controls are also difficult.

Players need to know whose turn it is. They need to see which tile is selected. They need to understand when ron or tsumo is available. The river must be readable. The hand must be usable on both desktop and mobile.

Mahjong is information dense. A tiny bit of confusion can make the whole game feel unreliable.

I learned that building a mahjong game and building something that feels playable as mahjong are not the same thing.

Where The Project Is Now

The project is not finished.

It is paused in the middle.

That is the honest status.

The current build has meaningful pieces in place:

  • room codes for playing with friends
  • an AI practice mode with three AI players
  • a four-seat lobby with names and ready states
  • dealing after all players are ready
  • server-side wall, hand, discard, and river state
  • private hand messages for each player
  • reconnect support
  • riichi, ron, and tsumo actions
  • yaku display after a win

On the rules side, the minimal layer includes winning shape checks, one-yaku enforcement, riichi, closed tsumo, tanyao, yakuhai, seven pairs, and thirteen orphans.

But important pieces are still missing:

  • chi, pon, and kan
  • dora
  • furiten
  • exact fu and score tables
  • honba and riichi sticks
  • stronger AI decision-making
  • more confidence in the full play flow

So I would not describe it as a finished mahjong game.

I would describe it as this:

It is a browser mahjong project that has become real enough to test, but not complete enough to fully trust as a game for friends yet.

Codex Helped, But It Did Not Remove The Need To Understand

Codex is OpenAI's AI coding agent. OpenAI describes it as a tool that can help read code, make edits, run commands, fix bugs, add features, and understand a codebase. Confirmed on May 25, 2026 from OpenAI's official Codex and Help Center pages.

That ability is real.

Codex helped with implementation, debugging, structure, tests, UI changes, and build checks. I do not think I would have reached this shape as quickly by myself.

But this project also made the limit very clear.

AI can write code, but it cannot decide what I actually mean by "playable mahjong" unless I can explain it.

If my understanding of the rules is vague, my prompt becomes vague. If I cannot tell whether the behavior is correct, I cannot properly review the result. If I do not know which rule matters next, the project drifts.

"Make it feel like mahjong" is not enough.

I had to decide what counted as the first version, what could wait, which rule was wrong, and what the user should see at each moment.

That was the real lesson.

AI coding does not remove judgment. It makes judgment more important, because the work moves faster.

Why I Still Want To Publish It

Part of me thinks I should wait until the game is more complete before sharing it.

But another part of me thinks the unfinished state is the point.

This is what AI-assisted development often feels like:

You begin with a simple idea. The first version appears faster than expected. Then the real domain complexity shows up.

That is not a failure. It is useful evidence.

The project already reached the web. It already became more than an idea. But it also showed me that building a game is not just generating code. It is understanding the game well enough to know what code should exist.

I started because I wanted a free browser mahjong game for friends.

I kept going because Codex made the project feel possible.

I paused because mahjong was more difficult than my first request made it sound.

That is a more honest development log than a clean success story.

The Takeaway

AI coding tools are powerful.

Codex is powerful.

But "ask and receive" is not the right mental model.

The better model is:

You bring the goal, the judgment, and the willingness to inspect the result. The AI brings speed, code, structure, and persistence. The finished thing comes from the loop between the two.

For this mahjong project, that loop has not reached the finish line yet.

But it has already taught me something useful:

AI can help me build further than I expected, but I still need to understand what I am building.

That is probably the real skill.

Work With Me

I write practical AI workflow and build-in-public notes from real projects like this: what worked, what broke, and what was actually useful. If you are exploring AI-assisted development, tools, or lightweight product experiments, you can follow along here.

References

コメント

タイトルとURLをコピーしました