← 3194379886a5 · 31b8bedd699a →

31a4112b4151

A 0-background grid contains one 4-connected prototype component with one or more color-9 target cells and a single-colored 3-6 cell shape. The first 9 in that component is the origin. Additional 9 targets may be isolated or may touch the prototype, and some targets may lie near an edge. The rule erases every 9 and stamps the prototype's non-9 relative offsets at every 9, clipping cells that fall outside the grid.

parametric family

Generated by the released generator before publication; every output was computed by its Racket reference rule. White outlines mark the cells the rule changed. Lesson check:

refuted: a demonstration contradicts the rival. survived_all: it fits every demonstration and also gives the intended answer, so it cannot mislead here. ambiguous: it fits every demonstration but answers the query differently. Names are as declared by the generator; a declared shortcut is not guaranteed to fit the original pairs (see the paper’s Limitations).

Original task pairs

From the source task; the reference rule must reproduce them.

Reference rule (Racket)

(rule! (let ((dummy 0)) (define dirs4 (list (list -1 0) (list 1 0) (list 0 -1) (list 0 1))) (define (components-any-nonzero grid) (let loop-pos ((positions (grid-positions grid)) (seen (list)) (acc (list))) (cond ((empty? positions) (reverse acc)) ((or (member? (first positions) seen) (= (at grid (first (first positions)) (second (first positions))) 0)) (loop-pos (rest positions) seen acc)) (else (let bfs ((queue (list (first positions))) (seen2 (cons (first positions) seen)) (cells (list))) (if (empty? queue) (loop-pos (rest positions) seen2 (cons (sort cells cell<) acc)) (let* ((cur (first queue)) (nbrs (filter (lambda (p) (and (in-bounds? (first p) (second p) (rows grid) (cols grid)) (not (member? p seen2)) (not (= (at grid (first p) (second p)) 0)))) (map (lambda (d) (list (+ (first cur) (first d)) (+ (second cur) (second d)))) dirs4)))) (bfs (append (rest queue) nbrs) (append seen2 nbrs) (cons cur cells))))))))) (let* ((comps (components-any-nonzero g)) (proto (first (filter (lambda (cells) (and (> (length cells) 1) (any? (lambda (p) (= (at g (first p) (second p)) 9)) cells))) comps))) (anchor (first (filter (lambda (p) (= (at g (first p) (second p)) 9)) proto))) (rel (filter values (map (lambda (p) (let ((v (at g (first p) (second p)))) (if (= v 9) #f (list (- (first p) (first anchor)) (- (second p) (second anchor)) v)))) proto))) (targets (find-color g 9))) (for/fold ((out (empty-grid (rows g) (cols g) 0))) ((target (in-list targets))) (for/fold ((acc out)) ((item (in-list rel))) (let ((r (+ (first target) (first item))) (c (+ (second target) (second item))) (v (third item))) (if (in-bounds? r c (rows g) (cols g)) (set-cell acc r c v) acc)))))))

Provenance

Generator
generators/31a4112b4151/generator.py
Notes and decisions
generators/31a4112b4151/notes.md
Review label
reviewed_safe
Generator SHA-256
a306bda8d3bcb161da5aba6a4a87bce60389b51b1338f02e108a9be127550874
Rule hash
1c0487137cc2
Sources
bank:7507d112faf2
Lesson seeds
20261108, 20261109, 20261110, 20261111, 20261112
Reproduce lesson 1
arcpuzzles generate 31a4112b4151 --count 1 --seed 20261108 --test 1