Scoundrel CLI

The card game from Classic Scoundrel, as a command line game. This page runs the same logic two ways: a terminal simulation, and a tiny React component. One core, no rewrites.

Play it in the terminal

Type commands just like the Node CLI. Cards are numbered, f flees, h helps, q quits. The buttons below the terminal send the same commands, for tapping.

Same game, React UI

The component below holds one game state and calls the same three functions: newGame, playCard, flee. No game logic lives in the component. Click a card to play it.

Loading the React demo...

const [game, setGame] = useState(() => newGame());

function doPlay(i) {
  const next = structuredClone(game);
  playCard(next, i);
  setGame(next);
}

How it fits together