← 56e5ade4e829 · 57488f2a7c15 →
56f043832ecb
A 0-background grid contains 1-2 hollow same-color objects in distinct colors: canonical rectangular frames and, in one scheduled profile, an exact rectangular frame with one outward spur. It may also contain one visually similar rectangle with a single non-corner wall gap. Fill every zero cell topologically enclosed by each hollow object with that object's color; preserve existing cells and leave the open decoy unchanged.
parametric familyholesobjectssame_sizetopology
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 (paint grid cells color) (for/fold ((out grid)) ((p (in-list cells))) (if (in-bounds? (first p) (second p) (rows out) (cols out)) (set-cell out (first p) (second p) color) out))) (define (component-grid obj) (let* ((bb (obj-bbox obj)) (h (+ 1 (- (third bb) (first bb)))) (w (+ 1 (- (fourth bb) (second bb))))) (for/fold ((out (empty-grid h w 0))) ((p (in-list (obj-cells obj)))) (set-cell out (- (first p) (first bb)) (- (second p) (second bb)) (obj-color obj))))) (define (hole-mask sub) (let* ((border-zeros (filter (lambda (p) (and (= (at sub (first p) (second p)) 0) (or (= (first p) 0) (= (second p) 0) (= (first p) (- (rows sub) 1)) (= (second p) (- (cols sub) 1))))) (grid-positions sub)))) (let bfs ((queue border-zeros) (seen border-zeros)) (if (empty? queue) (filter (lambda (p) (and (= (at sub (first p) (second p)) 0) (not (member? p seen)))) (grid-positions sub)) (let* ((cur (first queue)) (nbrs (filter (lambda (p) (and (in-bounds? (first p) (second p) (rows sub) (cols sub)) (= (at sub (first p) (second p)) 0) (not (member? p seen)))) (map (lambda (d) (list (+ (first cur) (first d)) (+ (second cur) (second d)))) dirs4)))) (bfs (append (rest queue) nbrs) (append seen nbrs))))))) (for/fold ((out g)) ((obj (in-list (objects g 0)))) (let* ((bb (obj-bbox obj)) (sub (component-grid obj)) (holes (hole-mask sub)) (shifted (map (lambda (p) (list (+ (first bb) (first p)) (+ (second bb) (second p)))) holes))) (paint out shifted (obj-color obj))))))
Provenance
- Generator
- generators/56f043832ecb/generator.py
- Notes and decisions
- generators/56f043832ecb/notes.md
- Review label
- reviewed_safe
- Generator SHA-256
- 45c8d0040b5a201132ac5bf3b5157e3a10053dbb7cce1ef67d803945affbbc5c
- Rule hash
- 29fbeb2dce83
- Sources
- bank:bc9ea2a8b0ce
- Lesson seeds
- 20261108, 20261109, 20261110, 20261111, 20261112
- Reproduce lesson 1
arcpuzzles generate 56f043832ecb --count 1 --seed 20261108 --test 1