← 94d475bf67ba · 9536d5aef3f6 →

952d011ee8be

Three distinct legend colors occupy three consecutive cells in row 0. Rows below a blank separator contain color-5 walls forming rectangular chambers. Count color-1 dots in each chamber: counts 1, 2, and 3 select the corresponding legend entry, while count 0 selects the last entry. Flood-fill the whole chamber, replacing dots as well as background. Generated scenes vary grid size, legend position/order, horizontal band split, chamber partition, and the row-major permutation of counts 0..3.

count-based recoloringlegend parsingregion flood-fill

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 (f14-paste-all out obj r0 c0) (for*/fold ((acc out)) ((r (in-range (rows obj))) (c (in-range (cols obj)))) (let ((nr (+ r0 r)) (nc (+ c0 c))) (if (in-bounds? nr nc (rows acc) (cols acc)) (set-cell acc nr nc (at obj r c)) acc)))) (define (f14-components-open grid wall) (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))) wall)) (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 (reverse cells) 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)) wall)))) (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* ((legend (filter (lambda (v) (not (= v 0))) (first g))) (sub (subgrid g 2 0 (- (rows g) 1) (- (cols g) 1))) (filled (for/fold ((out sub)) ((region (in-list (f14-components-open sub 5)))) (let* ((dot-count (length (filter (lambda (p) (= (at sub (first p) (second p)) 1)) region))) (color (if (= dot-count 0) (last legend) (list-ref legend (- dot-count 1))))) (paint-cells out region color))))) (f14-paste-all g filled 2 0))))

Provenance

Generator
generators/952d011ee8be/generator.py
Notes and decisions
generators/952d011ee8be/notes.md
Review label
reviewed_safe
Generator SHA-256
6a95f875df81153cb527dd5eb3332b5bdb4754f7e91fcc409fd0f0fdbc01a3a2
Rule hash
0b4a544c9655
Sources
bank:d82cc3a28c3b
Lesson seeds
20261108, 20261109, 20261110, 20261111, 20261112
Reproduce lesson 1
arcpuzzles generate 952d011ee8be --count 1 --seed 20261108 --test 1