← ee53f991985b · ee64b9b0fe20 →

ee602abaa45a

A canonical 14/15 by 22-24 canvas holds two distinct color-7/8/9 rectangular frames. Each frame contains both candidate templates (colors 1 and 2), a selector cell choosing one candidate, and transform code 3/4/5/6 for identity/rotate-CW/rotate-180/flip-LR. Transform the selected tight crop, recolor it to the frame border, and h-stack the two pieces in frame reading order, vertically centered with a one-cell gap.

framed subproblemslocal template selectionlocal transform codespackingrecoloring

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 (nonzero-cells grid) (filter (lambda (p) (not (= (at grid (first p) (second p)) 0))) (grid-positions grid))) (define (crop-nonzero grid) (let ((cells (nonzero-cells grid))) (if (empty? cells) (list (list 0)) (let* ((bb (bbox-of-cells cells))) (subgrid grid (first bb) (second bb) (third bb) (fourth bb)))))) (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 (e8b-paste grid pat top left) (for*/fold ((out grid)) ((r (in-range (rows pat))) (c (in-range (cols pat)))) (let ((v (at pat r c)) (rr (+ top r)) (cc (+ left c))) (if (and (not (= v 0)) (in-bounds? rr cc (rows out) (cols out))) (set-cell out rr cc v) out)))) (define (f14b-hstack-center grids (gap 1)) (if (empty? grids) (list (list)) (let* ((h (apply max (map rows grids))) (w (+ (apply + (map cols grids)) (* gap (- (length grids) 1))))) (let loop ((xs grids) (left 0) (out (empty-grid h w 0))) (if (empty? xs) out (let* ((piece (first xs)) (top (quotient (- h (rows piece)) 2))) (loop (rest xs) (+ left (cols piece) gap) (e8b-paste out piece top left)))))))) (define (s17b-object< a b) (let ((ba (obj-bbox a)) (bb (obj-bbox b))) (e8b-list< (list (first ba) (second ba)) (list (first bb) (second bb))))) (define (t10-alist-ref pairs key default) (let ((hits (filter (lambda (p) (= (first p) key)) pairs))) (if (empty? hits) default (second (first hits))))) (define (t10b-transform grid code) (cond ((= code 1) grid) ((= code 2) (rotate-cw grid)) ((= code 3) (rotate-180 grid)) ((= code 4) (flip-lr grid)) ((= code 5) (flip-ud grid)) ((= code 6) (rotate-ccw grid)) (else grid))) (define (t10b-recolor grid color) (grid-from-fn (rows grid) (cols grid) (lambda (r c) (if (= (at grid r c) 0) 0 color)))) (let* ((frame-objs (sort (filter (lambda (obj) (>= (obj-color obj) 7)) (objects g 0)) s17b-object<)) (parts (for/list ((obj (in-list frame-objs))) (let* ((bb (obj-bbox obj)) (r0 (first bb)) (c0 (second bb)) (r1 (third bb)) (c1 (fourth bb)) (bcolor (obj-color obj)) (bottom (- r1 1)) (sel (at g bottom (+ c0 1))) (tf (at g bottom (+ c0 2))) (cand (grid-from-fn (- r1 r0 1) (- c1 c0 1) (lambda (r c) (let ((rr (+ r0 1 r)) (cc (+ c0 1 c))) (if (and (< rr bottom) (= (at g rr cc) sel)) sel 0))))) (chosen (crop-nonzero cand)) (transformed (t10b-transform chosen (t10-alist-ref (list (list 3 1) (list 4 2) (list 5 3) (list 6 4)) tf 1)))) (t10b-recolor transformed bcolor))))) (f14b-hstack-center parts 1))))

Provenance

Generator
generators/ee602abaa45a/generator.py
Notes and decisions
generators/ee602abaa45a/notes.md
Review label
reviewed_safe
Generator SHA-256
15a28ca66e95270f6233945fdf9e33350a738c8b87e47623de97dbb3c9e5307f
Rule hash
9c5ac46b22bb
Sources
bank:ad4abc25f505
Lesson seeds
20261108, 20261109, 20261110, 20261111, 20261112
Reproduce lesson 1
arcpuzzles generate ee602abaa45a --count 1 --seed 20261108 --test 1