DEV NOTE
Card JanggiPoint OmokCard Janggi and Point Omok AI dev notes
When it cannot see your hand, the AI imagines every possibility.
Card Janggi and Point Omok both arrived on the nights of 24–25 November, and in both you play without knowing what the other side chose: in Card Janggi, the order of their face-down cards; in Point Omok, the points they bid in secret.
The first rule for a fair AI is the same in both: it gets only what a player in that seat knows. This note shows how each AI handles what it does not know.
Published · 2026-11-26
Card Janggi: the rules
Card Janggi is match 1 of the final of The Devil’s Plan: Dead Again. On a 6×5 board each side has a king and three small pieces, and both share the same five movement cards (rat: one square orthogonally; horse: a knight’s jump; monkey: one square in eight directions; elephant: a diagonal slide; giraffe: exactly two squares orthogonally, jumping). Both lay out their card order face down at the same time (the first player five cards, the second four in its first cycle only) and turn them up one by one, moving a piece as each card allows. Take the enemy king, or move your king onto its starting square, to win.
What the show left open, the site decided: a card with no legal move is simply used up, the giraffe jumps while the elephant is blocked, and a round that runs too long goes to the side with more pieces. The code comment lists these separately as "calls the show left open (ours)".
The Card Janggi AI: every possible world
Card Janggi has a single AI level, Hard. It is given its own layout, and of yours only the cards already used and the one face up. The order of your remaining face-down cards is unknown.
STEP 01
Build the worlds
Each order your face-down cards could be in is a "world". With at most four face-down cards there are at most 4! = 24.
STEP 02
An ordinary game per world
Within one world both layouts are fixed, so it is an ordinary two-player game with no hidden information. Alpha-beta with a transposition table (iterative deepening) scores every move.
STEP 03
Pick by the average
It plays the move with the best average win chance over all worlds — a move that is decent in most worlds rather than great in one.
Laying out cards is harder: five cards have 120 orders, so the AI grows the order one card at a time — candidate first cards, then first two, keeping only the best prefixes (a beam search). Each prefix is searched just far enough to see all its cards played, against the possible orders of yours. Beyond the end of a known layout, a side is assumed to play any card it has left in that cycle.
The launch commit also included a self-play script (`scripts/card-janggi-arena.ts`). It plays the AI against a simple "win or capture when you can" side and a random one, checking every state on the way: one king each while the round is on, no piece appearing from nowhere, face-down cards never handed to the other side.
Point Omok: the rules
In Point Omok, each round the chooser marks three empty points in a row, and both players secretly split their points over them. Each point gets the stone of whoever bid more; a tie goes to the player who did not choose. You get 10 points a round, half of what is left (rounded down) carries over, and every point needs at least 1. More fives wins, and six or more in a row is not a five — a fix made separately right after launch.
The Point Omok AI: narrowing budgets, and styles
The AI gets the board, the public record of each round (who chose, which points, whose stone landed where) and its own bids — never your bids or your points.
- Choosing points: for each line of three near the stones, it looks at how the board would be after each of the eight ways the three points could fall, weighted by how likely each is.
- Bidding (Hard): from the grant and carry rules and past results it narrows your remaining points to a range, samples your bids from it, scores every split of its own points by expected board value plus the value of what it carries over, and draws one of the best — so its bids cannot be read off the board.
Six bidding styles
Eight minutes after launch Easy was dropped and each AI game draws a bidding style at random, so habits from one game do not carry to the next; about one round in seven is played in another style. The style is revealed on the result screen. Styles bend only quiet rounds: with a five at stake the expected value dominates and every style bids to win.
| Style | Values carrying | Share bid | Piling | Mixing |
|---|---|---|---|---|
| Balanced | 1 | 65–90% | normal | 0.25 |
| Saver | 1.9 (saves a lot) | 45–70% | normal | 0.25 |
| Aggressive | 0.35 (hardly saves) | 90–100% | normal | 0.2 |
| Sniper | 1 | 70–100% | piles on one point (2.2) | 0.3 |
| Spread | 0.9 | 65–90% | spreads evenly (0.6) | 0.25 |
| Bluffer | 1.1 | 50–100% | normal | 0.55 (mixes most) |
According to the commit, in self-play Hard beat Normal 19–20 games out of 20 in every style.
Real win rates
Signed-in players’ games against the AI as of 2026-11-26, 14:00 KST.
People won 18.8% of 416 games against Card Janggi’s Hard — a little harder than the 25% target. In Point Omok they won 45.5% against Hard (233 games) and 56.1% against Normal (132).
| Style | Human win rate | Games |
|---|---|---|
| Bluffer | 36.0% | 75 |
| Saver | 46.4% | 56 |
| Sniper | 47.8% | 67 |
| Spread | 48.2% | 56 |
| Balanced | 56.9% | 58 |
| Aggressive | 61.9% | 63 |
The Bluffer, which mixes most, was hardest, and the Aggressive style, which never saves, easiest — the same lesson as Black & White: an AI that cannot be read is strong. With only about 60 games per style, though, the gaps need more time.
Gaps a human can use
The trap of averages
The AI chooses by the average over all worlds. The rarer your actual order is among them, the thinner its preparation. Lay out your first cards unpredictably and its averages miss.
Outside its beam
Its own order is grown one card at a time keeping the best prefixes, so its first two or three cards are likely the "good right now" ones. Use its face-up first card to guess the rest.
Read the style early
Within a game, one style plays most rounds. Watch the size and piling of its first few bids, guess the style, and set your carry-over plan for the rest.
Quiet rounds
Styles show in rounds with no five at stake. Savers and Bluffers often bid low then — take your points cheaply.
Where this comes from
This note is written only from the code, the commit history and the aggregate numbers below.
- `src/lib/cardJanggi.ts` (rules and the show’s open calls), `src/lib/cardJanggiAi.ts` (worlds, beam search), `scripts/card-janggi-arena.ts`
- `src/lib/pointOmok.ts` (rules), `src/lib/pointOmokAi.ts` (PO_STYLES, STYLE, bidding)
- Commits d915a97 (11/24 Point Omok, overline fix), 3e2be87 (11/24 Easy dropped, six styles, self-play), d8bb731 (11/25 Card Janggi)
- DB aggregates (2026-11-26 14:22 KST): game_results (game = card_janggi, point_omok; mode = ai) win rate by level, Point Omok win rate by detail.style
Read next
- How the Wallgo AI plays
From a reach-first territory estimate to alpha-beta with a transposition table: what each Wallgo AI level computes, and where it is weak.
- 12 Janggi AI dev notes
Why a 7-ply Hard was almost unbeatable and went down to 5, the no-third-repetition ban, and a Very Hard that reads 13–19 plies.
- Russian Janggi AI dev notes
Even the Very Hard engine that reads to the end must lose to a first-move large cup in the centre — and how that shaped the AI and its win rate.