← 46c02325ed3b · 474634a9f7b7 →
4729a9750abc
Two or three side-by-side hollow color-9 frames each contain one to three same-color 4-connected components with distinct sizes. A 2/3 key above each frame selects its smallest/largest component; a 3/4/5/6 key on the left applies identity/clockwise/left-right/180-degree transformation. Crop each selected component and horizontally pack the transformed pieces in frame order with one blank column and vertical centering.
gallery packinglocal frame reasoninglocal transformsrank selection
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!
;; Each maroon(9) rectangular FRAME holds a few components. The key dot row
;; ABOVE the frame picks which one (2 = smallest, else largest); the key dot
;; column LEFT of it picks a transform (4 = rotate-cw, 5 = flip-lr,
;; 6 = rotate-180, else identity). The chosen, transformed parts line up
;; horizontally (vertically centered, 1-col gaps), frames in top-left order.
(lambda (g)
(let ()
(define (crop-nonzero grid)
(let ((cells (filter (lambda (p) (!= (at grid (first p) (second p)) 0))
(grid-positions grid))))
(if (empty? cells)
(list (list 0))
(let ((bb (bbox-of-cells cells)))
(subgrid grid (first bb) (second bb) (third bb) (fourth bb))))))
(define (rect-frame? obj)
;; exactly the border of a >=3x3 bbox: every cell on the border AND
;; the cell count equals the perimeter
(let* ((bb (obj-bbox obj))
(hh (+ 1 (- (third bb) (first bb))))
(ww (+ 1 (- (fourth bb) (second bb)))))
(and (>= hh 3) (>= ww 3)
(= (obj-size obj) (- (* 2 (+ hh ww)) 4))
(all? (lambda (p) (or (= (first p) (first bb))
(= (first p) (third bb))
(= (second p) (second bb))
(= (second p) (fourth bb))))
(obj-cells obj)))))
(define frames
(sort (filter (lambda (o) (and (= (obj-color o) 9) (rect-frame? o)))
(objects g 0))
(lambda (a b)
(let ((ba (obj-bbox a)) (bb (obj-bbox b)))
(or (< (first ba) (first bb))
(and (= (first ba) (first bb))
(< (second ba) (second bb))))))))
(define (first-key vals)
(first (filter (lambda (v) (not (member? v (list 0 9)))) vals)))
(define (key-above fr)
(let ((bb (obj-bbox fr)))
(first-key (if (>= (- (first bb) 1) 0)
(map (lambda (c) (at g (- (first bb) 1) c))
(range (second bb) (+ (fourth bb) 1)))
(list)))))
(define (key-left fr)
(let ((bb (obj-bbox fr)))
(first-key (if (>= (- (second bb) 1) 0)
(map (lambda (r) (at g r (- (second bb) 1)))
(range (first bb) (+ (third bb) 1)))
(list)))))
(define (part-of fr)
(let* ((bb (obj-bbox fr))
(sub (subgrid g (+ (first bb) 1) (+ (second bb) 1)
(- (third bb) 1) (- (fourth bb) 1)))
(comps (sort (objects sub 0)
(lambda (a b) (< (obj-size a) (obj-size b)))))
(chosen (if (= (key-above fr) 2) (first comps) (last comps)))
(part (crop-nonzero
(paint-cells (empty-grid (rows sub) (cols sub) 0)
(obj-cells chosen) (obj-color chosen)))))
(cond ((= (key-left fr) 4) (rotate-cw part))
((= (key-left fr) 5) (flip-lr part))
((= (key-left fr) 6) (rotate-180 part))
(else part))))
(define (hstack-center pieces)
(if (empty? pieces)
(list (list))
(let* ((hh (apply max (map rows pieces)))
(ww (+ (apply + (map cols pieces)) (- (length pieces) 1))))
(let loop ((xs pieces) (left 0) (out (empty-grid hh ww 0)))
(if (empty? xs)
out
(let ((piece (first xs)))
(loop (rest xs) (+ left (cols piece) 1)
(paste out piece
(quotient (- hh (rows piece)) 2)
left))))))))
(hstack-center (map part-of frames)))))Provenance
- Generator
- generators/4729a9750abc/generator.py
- Notes and decisions
- generators/4729a9750abc/notes.md
- Review label
- reviewed_safe
- Generator SHA-256
- 7e60d5b4d4f2b05024e86e305971a353532a59b8ff739bb3d6cd95df09deb871
- Rule hash
- 12e5396a1c4e
- Sources
- bank:9f005a7005fe
- Lesson seeds
- 20261108, 20261109, 20261110, 20261111, 20261112
- Reproduce lesson 1
arcpuzzles generate 4729a9750abc --count 1 --seed 20261108 --test 1