← 2d4e8c8fa10e · 2d5acf84dd20 →
2d59c1b766d5
Two color-8 rectangular frames contain gray walls and one colored gate. Flood only gate-reachable zeros with four-neighbor movement. Scheduled open, sealed, and diagonal-wall profiles make reachability and the four-neighbor convention identifiable under every query rotation.
flood fillframed subproblemsinternal wallssame-size transform
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 (e8b-list< a b) (cond ((empty? a) #f) ((< (first a) (first b)) #t) ((> (first a) (first b)) #f) (else (e8b-list< (rest a) (rest b))))) (define (f14-same-cells? a b) (and (= (length a) (length b)) (all? (lambda (p) (member? p b)) a))) (define (f14-border-cells r0 c0 r1 c1) (for*/list ((r (in-range r0 (+ r1 1))) (c (in-range c0 (+ c1 1))) #:when (or (= r r0) (= r r1) (= c c0) (= c c1))) (list r c))) (define (f4-norm cells) (let* ((bb (bbox-of-cells cells)) (r0 (first bb)) (c0 (second bb))) (map (lambda (p) (list (- (first p) r0) (- (second p) c0))) cells))) (define (f4-norm-info cells) (let* ((bb (bbox-of-cells cells)) (r0 (first bb)) (c0 (second bb)) (r1 (third bb)) (c1 (fourth bb))) (list (f4-norm cells) (+ 1 (- r1 r0)) (+ 1 (- c1 c0))))) (define (f4-rect-frame? cells) (let* ((info (f4-norm-info cells)) (norm (first info)) (h (second info)) (w (third info)) (border (f14-border-cells 0 0 (- h 1) (- w 1)))) (and (>= h 3) (>= w 3) (f14-same-cells? norm border)))) (define (s7b-frame-boxes grid color) (map obj-bbox (sort (filter (lambda (obj) (and (= (obj-color obj) color) (f4-rect-frame? (obj-cells obj)))) (objects grid 0)) (lambda (a b) (e8b-list< (obj-bbox a) (obj-bbox b)))))) (define (s7b-inside box) (list (+ (first box) 1) (+ (second box) 1) (- (third box) 1) (- (fourth box) 1))) (define (s6b-frame-boxes grid color) (s7b-frame-boxes grid color)) (define (t10b-fill-gate-frames grid) (for/fold ((out grid)) ((box (in-list (s6b-frame-boxes grid 8)))) (let* ((ibox (s7b-inside box)) (ir0 (first ibox)) (ic0 (second ibox)) (ir1 (third ibox)) (ic1 (fourth ibox)) (vals (filter (lambda (p) (let ((v (at grid (first p) (second p)))) (not (member? v (list 0 5 8))))) (positions-in-rect ir0 ic0 ir1 ic1)))) (if (empty? vals) out (let* ((gate (first vals)) (color (at grid (first gate) (second gate))) (region (let bfs ((queue (list gate)) (seen (list gate)) (cells (list))) (if (empty? queue) (reverse cells) (let* ((cur (first queue)) (nbrs (filter (lambda (p) (and (<= ir0 (first p) ir1) (<= ic0 (second p) ic1) (not (member? p seen)) (member? (at grid (first p) (second p)) (list 0 color)))) (map (lambda (d) (list (+ (first cur) (first d)) (+ (second cur) (second d)))) dirs4)))) (bfs (append (rest queue) nbrs) (append seen nbrs) (cons cur cells))))))) (paint-cells out region color)))))) (t10b-fill-gate-frames g)))
Provenance
- Generator
- generators/2d59c1b766d5/generator.py
- Notes and decisions
- generators/2d59c1b766d5/notes.md
- Review label
- reviewed_safe
- Generator SHA-256
- 33afef8aad91520ecf7854b65e1520c64ccaab421f7330c359717b2a6c55bfab
- Rule hash
- 61c97755a0ea
- Sources
- bank:ad4abc25f505
- Lesson seeds
- 20261108, 20261109, 20261110, 20261111, 20261112
- Reproduce lesson 1
arcpuzzles generate 2d59c1b766d5 --count 1 --seed 20261108 --test 1