← b0087e6a72e9 · b0e266482663 →
b0881729e53a
Find the hollow rectangular frame. Among all other same-color 4-connected components, select the last component in row-major discovery order. Erase every non-frame component, crop the selected component to its bounding box, and paste that shape unchanged at the floor-centered position inside the frame's interior.
framesobjectsrelocationsame_size
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 (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 (outline-rel h w) (remove-duplicates (append (for/list ((c (in-range w))) (list 0 c)) (for/list ((c (in-range w))) (list (- h 1) c)) (for/list ((r (in-range h))) (list r 0)) (for/list ((r (in-range h))) (list r (- w 1)))))) (define (frame-object? obj) (let* ((bb (obj-bbox obj)) (h (+ 1 (- (third bb) (first bb)))) (w (+ 1 (- (fourth bb) (second bb)))) (rel (sort (normalize-cells (obj-cells obj)) cell<)) (outline (sort (outline-rel h w) cell<))) (and (>= h 3) (>= w 3) (equal? rel outline)))) (define (center-position frame-bb shape-h shape-w) (let* ((r0 (first frame-bb)) (c0 (second frame-bb)) (r1 (third frame-bb)) (c1 (fourth frame-bb)) (fh (+ 1 (- r1 r0))) (fw (+ 1 (- c1 c0)))) (list (+ r0 (quotient (- fh shape-h) 2)) (+ c0 (quotient (- fw shape-w) 2))))) (define (paste-shape out shape top left) (for*/fold ((acc out)) ((r (in-range (rows shape))) (c (in-range (cols shape)))) (let ((v (at shape r c)) (rr (+ top r)) (cc (+ left c))) (if (and (not (= v 0)) (in-bounds? rr cc (rows acc) (cols acc))) (set-cell acc rr cc v) acc)))) (let* ((frame (first (filter frame-object? (objects g 0)))) (obj (first (reverse (filter (lambda (o) (not (frame-object? o))) (objects g 0))))) (shape (component-grid obj)) (frame-bb (obj-bbox frame)) (interior (list (+ (first frame-bb) 1) (+ (second frame-bb) 1) (- (third frame-bb) 1) (- (fourth frame-bb) 1))) (pos (center-position interior (rows shape) (cols shape)))) (paste-shape (paint (empty-grid (rows g) (cols g) 0) (obj-cells frame) (obj-color frame)) shape (first pos) (second pos)))))
Provenance
- Generator
- generators/b0881729e53a/generator.py
- Notes and decisions
- generators/b0881729e53a/notes.md
- Review label
- reviewed_safe
- Generator SHA-256
- 15493318af330aba653bcc87efc34f5324527aea67ccd40b99bc1bc11d51e2de
- Rule hash
- b7117efbdd28
- Sources
- bank:bc9ea2a8b0ce
- Lesson seeds
- 20261108, 20261109, 20261110, 20261111, 20261112
- Reproduce lesson 1
arcpuzzles generate b0881729e53a --count 1 --seed 20261108 --test 1