← 24b83272f157 · 24d677c76640 →
24bb2221ca5c
A 0-background grid contains 1-2 closed hollow same-color objects in one or more colors. Canonical scenes use rectangular frames. One scheduled contrast pairs a corner-gap frame, whose interior remains 4-connectedly enclosed, with a side-gap frame whose interior is open. Another scheduled control uses a dense two-cavity object with an L-shaped hole and one outward spur plus a disconnected same-color frame. Fill every zero cell topologically enclosed inside each closed object with that object's color, preserve all existing nonzero cells, and leave open regions unchanged.
parametric familyhole fillingsame-size transformtopology
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 (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 (binary-grid grid) (grid-from-fn (rows grid) (cols grid) (lambda (r c) (if (= (at grid r c) 0) 0 1)))) (define (holes-in-binary grid) (let loop-pos ((positions (grid-positions grid)) (seen (list)) (acc (list))) (cond ((empty? positions) acc) ((or (member? (first positions) seen) (not (= (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)) (touches #f)) (if (empty? queue) (loop-pos (rest positions) seen2 (if touches acc (append cells acc))) (let* ((cur (first queue)) (r (first cur)) (c (second cur)) (border (or (= r 0) (= c 0) (= r (- (rows grid) 1)) (= c (- (cols grid) 1)))) (nbrs (filter (lambda (p) (and (in-bounds? (first p) (second p) (rows grid) (cols grid)) (not (member? p seen2)) (= (at grid (first p) (second p)) 0))) (map (lambda (d) (list (+ r (first d)) (+ c (second d)))) dirs4)))) (bfs (append (rest queue) nbrs) (append seen2 nbrs) (cons cur cells) (or touches border))))))))) (for/fold ((out g)) ((obj (in-list (objects g 0)))) (let* ((cg (component-grid obj)) (holes (holes-in-binary (binary-grid cg))) (bb (obj-bbox obj))) (for/fold ((acc out)) ((p (in-list holes))) (set-cell acc (+ (first bb) (first p)) (+ (second bb) (second p)) (obj-color obj)))))))
Provenance
- Generator
- generators/24bb2221ca5c/generator.py
- Notes and decisions
- generators/24bb2221ca5c/notes.md
- Review label
- reviewed_safe
- Generator SHA-256
- e857d9cf20ec790738140a995e6987bfafc85080b6f871acef89e552312aac5e
- Rule hash
- 514c258ab731
- Sources
- bank:01130745873d
- Lesson seeds
- 20261108, 20261109, 20261110, 20261111, 20261112
- Reproduce lesson 1
arcpuzzles generate 24bb2221ca5c --count 1 --seed 20261108 --test 1