soma.cell

Programs: games

19 verified Soma programs in the games domain. Each page shows the source and what soma check, soma test, soma verify and soma run printed on it.

ProgramLinesUses
Blackjack — hand scoring with soft/hard aces and bust detection hand_value() sums card ranks, counting each Ace as 11 then demoting to 1 while the total busts86match
Card deck — build, deterministic Fisher-Yates shuffle, and deal85
Connect Four — drop a disc and detect four-in-a-row93
Conway's Game of Life — one generation step on a fixed grid82
Craps — the come-out roll and point-resolution rules come_out(total) resolves the first roll: 7/11 wins, 2/3/12 craps out, any other number becomes the "point"77match
2048 — slide-and-merge a single row (the core move primitive)77
Number guessing game — hi/lo feedback and a binary-search solver feedback() compares a guess to the secret and returns "low" / "high" / "correct"67match
Tower of Hanoi — minimum moves and an explicit move list min_moves(n) = 2^n - 178
Mastermind — score a guess with black and white pegs92match
Maze movement — one step with wall collision on a grid82
Minesweeper — compute the neighbour-mine board from a mine layout mines is a flat row-major r×c list of 0/177
Nim — optimal play via the Sprague-Grundy nim-sum75
Pig — the press-your-luck dice game, scored from a roll log66lambdas
Rock-paper-scissors — round judging and best-of-N scoring judge(a, b) returns "p1", "p2", or "tie" from the two throws72match
Snake — one movement tick with growth, wall and self collision75lambdas
Tic-tac-toe win detection — pure board logic67lambdas
Turn tracker — round/phase state machine with player rotation71a state machine
War — the card-comparison game, played to exhaustion76
Yahtzee — score a roll of five dice in any category counts() buckets the five dice into face frequencies99lambdas