장기 · JANGGI
References & credits
A game with a long history, made possible here by a generous community. Thank you to the players, writers and open source contributors whose work helped us build it.
View the source on GitHubJanggi by Neil Armstrong · MIT licence
Rules & match formats
Janggi has more than one tradition of play. In this app, Casual lets a called bikjang end in a draw. Scored adds conditions and settles it on points. These formats are our reading of the sources below, whose accounts of bikjang, repetition and passing do not always agree.
대한장기협회 · Korea Janggi Association
The association’s match regulations informed scoring, repetition and the 30-point condition for bikjang, including the exception after a general captures a piece. In Korean.
대한장기연맹 · Korean Janggi Federation
A separate federation. Its 2020 revision abolished draws in its tournaments and supplied the points-based reading. Its 2022 revision clarifies passing and settlement after two consecutive passes. In Korean.
Wikipedia contributors · Janggi / 장기
English and Korean accounts helped cross-check the board, piece movements, values, Han’s 1.5-point allowance and casual play. Community explanations sometimes differ from federation regulations.
PyChess Variants contributors
A working janggi implementation and an accessible explanation of the game. Consulted for cannon movement along palace diagonals, adjudication and opening choices. Its setup names need care when comparing board orientation.
How this app interprets the rules
Our research notes trace every piece’s moves and explain the decisions made where the sources disagree, including the distinction between Casual and Scored.
Opening arrangements & variants
Names for horse and elephant arrangements can change with the writer’s viewpoint. We compared diagrams, move lists and Korean terminology to settle the app’s opening names and its descriptions of facing and crossed elephants.
장하영 · Jang Ha-young, writing in 서산시대
A professional player’s columns supplied annotated games, formation statistics and discussion of 맞상. The move lists helped resolve which board orientation a description actually meant. Some naming differs even between the columns. In Korean.
Korean Wikipedia & Wikimedia Commons contributors
The elephant article and opening diagrams supplied explicit placements for 왼상차림. The English setup template also helped establish how Wikipedia draws the two armies.
한게임 · Hangame janggi glossary
Korean names for the four arrangements, formation vocabulary and the distinction between an initial arrangement and a developed opening. Its orientation is not always explicit.
BrainTV · Opening formations and their strengths
Descriptions of five formations and their tradeoffs helped connect starting arrangements with the openings they lead to. In Korean.
Supporting community sources · Namu Wiki
Namu Wiki and the janggi discussion board helped compare everyday usage of 맞상 and 엇상. These were available only through search summaries during the research, so they back up the comparison but don't settle a rule.
The Chess Variant Pages & Korean Wikibooks contributors
Further background on setup order, the sixteen combinations and developed opening formations. The Chess Variant Pages article may require its archived copy.
How this app names the openings
The full comparison, with diagrams, translated passages, decoded move lists and an assessment of each source’s evidence.
The computer opponent
Thank you to Fabian Fichter and the Fairy-Stockfish and Stockfish contributors for the engine behind the bot. This app checks every move against its own rules before playing it. The displayed bot strengths are nominal Elo, calibrated on chess, not janggi.
Fairy-Stockfish
The open source engine searches for the bot’s moves. Its built-in janggi variants differ from this app on bikjang and repetition, which is why our game engine remains the referee.
GPL-3.0 licencefairy-stockfish-nnue.wasm
The WebAssembly port lets the engine run on your device, inside the browser. Its published engine files are served unmodified with their licence and authors list.
GPL-3.0 licenceGuido Zuidhof & coi-serviceworker contributors
Credit for the service-worker technique that makes threaded WebAssembly possible on hosts such as GitHub Pages. This app implements that approach in its own service worker and does not install this library.
MIT licenceHow the bot fits this app’s rules
Our notes on engine variants, move validation, nominal strength and running the engine in an installable web app.
Open source software & tools
The app and its development tools are built on the work of these projects and their contributors. Related packages are credited together below, with links to their source and licence terms.
React & React DOM
Render the board, controls and this page. The React Hooks ESLint plugin checks how our hooks are used.
MIT licenceRedux Toolkit
Manages the game, preferences and results as predictable state changes.
MIT licenceReact Redux
Connects the React interface to the game’s stored state.
MIT licenceclsx
Assembles the class names used to show selections, moves and interface states.
MIT licenceTailwind CSS & its Vite plugin
Provides the styling utilities for the board and the interface around it.
MIT licenceVite
Serves the app during development and builds the files deployed to GitHub Pages.
MIT licenceVite PWA
Builds and registers the service worker and generates the installable app manifest.
MIT licenceWorkbox
Keeps the app available offline through its build, precaching, routing and window packages.
MIT licenceTypeScript
Checks the types shared by the game, interface and tests.
Apache-2.0 licencepnpm
Installs the pinned dependencies and runs the workspace’s commands.
MIT licencePlaywright
Drives real browsers through the acceptance tests on desktop and mobile viewports.
Apache-2.0 licenceVitest
Runs the unit tests, including the rules and the decisions behind the interface.
MIT licenceTesting Library
React Testing Library, DOM Testing Library and jest-dom support the custom-hook tests and their assertions.
MIT licencefast-check
Generates random games and positions to look for rule failures, then shrinks failures to smaller examples.
MIT licencejsdom
Provides a browser-like document for hook tests running under Node.
MIT licenceESLint & @eslint/js
Checks code quality and enforces the boundaries between the workspace packages.
MIT licencetypescript-eslint
Lets ESLint understand TypeScript and check rules that depend on types.
MIT licenceESLint React
Checks the React components for correctness.
MIT licenceglobals
Tells the lint configuration which global names belong to browsers and Node.
MIT licencePrettier
Formats the code consistently. eslint-config-prettier stops formatting and lint rules from conflicting.
MIT licenceDefinitelyTyped contributors
Maintains the React, React DOM and Node type definitions used throughout the project.
MIT licence