弈
弈方 YIFANG · THE ART OF PLAY
中文

Mahjong · Play with friends

The host creates a room and sends the invitation link; friends open it and the host lets them in. Play starts once everyone is seated. No account needed.

Four players. Pick the rules your table agreed on; each ruleset has its own room.

Four-player riichi

Four players, each on their own device. One opens the room as host; the other three join.

Not connected

Host · Player 1

Open a room

  1. Create the room — you are Player 1
  2. Send the same invitation link to all three friends
  3. Let each friend in as they open it; start when all four are in

Guest

Join as a guest

  1. Open the host’s link — you join automatically
  2. Or paste the link below and choose Join room
  3. Wait for the host to start
Connection notes and troubleshooting

Link mode: the PeerJS public service passes on connection details (its defaults also try third-party STUN and may relay through TURN); once connected, match data travels between the players. If it never connects (for example the service is blocked on your network), switch to invitation + reply codes below. The text-exchange notes below apply to code mode only.

No registration. Code mode (described here) uses no backend or signaling service. The host exchanges a separate text pair with each of three friends. LAN is recommended; cross-network success is not guaranteed without relays. Each device needs a valid HTTPS site: localhost refers only to that device, and plain HTTP on a LAN IP lacks the secure context required for refresh recovery. Share connection text privately with your table only.

The trusted host browser owns the wall and rules. This is not a cheat-proof server or a money game. A disconnection freezes play. Recovery requires the original host and three guests, each with their tab save and fresh invitations.

After play starts, progress is saved in this tab’s sessionStorage. The host save contains the original walls, full action log and four recovery credentials; a guest saves only their seat view and credential. Never export or share saves. After refresh, the host restores first and makes fresh invitations for the original seats. Guests restore before pasting their own new invitations. Once all four return, the host continues without a new deal. Closing the tab, clearing data or blocked storage can lose the save; device migration is unsupported.

Japanese riichi · Four-player table

Four humans start with 25,000 points each. Highest score wins the East-round match. A usual winning hand needs four groups, a pair and at least one yaku; dora alone is insufficient. Click enabled tiles to discard; other actions appear only when legal. All four must acknowledge results. Same preset as local riichi: no red fives, open tanyao, no double/counted yakuman, combined yakuman, no extension, dealer repeats on win/ready hand, negative points end play.