🖍️ Darkwaar27 : Pigment — Un casse-tête avec des dés basé sur la rotation et l'algèbre des couleurs
Lire : https://darkwoodcom.itch.io/darkwaar27 Un dé, une règle Pigment est un casse-tête déterministe se jouant sur un plateau de 5×5. Un dé occupe une case du plateau. Une commande le déplace vers une case voisine orthogonale et le fait pivoter de quatre-vingt-dix degrés afin qu’une nouvelle face soit tournée vers le bas. Cette face tournée vers le bas colore la case de destination. Rien d’autre…
Pigment is a deterministic puzzle game played on a 5x5 board, featuring a single die occupying one of the board's cells. The die, consisting of six integer values corresponding to each face (D, U, N, S, E, W), rotates upon moving to an adjacent orthogonal cell and determining a new face to face down. This face then colors the destination cell.
No other elements move; the player never selects a color through a menu. Instead, the color displayed is determined by the face the die lands on after rotation. The four directions correspond to a pathfinding calculation and also redefine the available faces in subsequent turns. Five levels created by the author, a shot limit per board, and undo/replay functions govern gameplay.
The die model incorporates six integer values (D, U, N, S, E, W) for each face, with opposite colors fixed (black ↔ white, red ↔ blue, yellow ↔ green). Each level begins with a consistent orientation: the bottom face is black, top face white, north face red, south face blue, east face yellow, and west face green. Subsequent rotations shift these face positions.
A function roll (die: Dictionary, action: String) manipulates these values based on the action direction (east, west, north, south). A match-case function ensures permutations of die states, maintaining opposite color consistency; if D is red, U must remain blue. Colors form an alphabet of seven primary and secondary shades (empty, red, yellow, blue, white, black, orange, violet, green).
Landing on an empty cell writes the color via a deterministic function (existing color, landing face). The die's face-down color is recorded in the cell. Mixing primary colors creates secondary hues; applying the same primary color twice has no effect. White erases all, including sealed cells, while black seals a cell permanently. A primary color applied to a secondary color or sealed cell seals the latter.
Rewritten by urgent.news; may contain errors — check the original.
Source: dev.to