← 9f05dcdedf35 · 9f74cf8633e5 →
9f362acbf729
Read transform keys 1..4 from the four corners, tightly crop the remaining colored body, transform one copy per key, and pack the copies into a 2×2 top-aligned mosaic with one-cell gaps.
marker_controlmosaicoutput_resizetransforms
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 (crop-nonzero grid) (let ((cells (filter (lambda (p) (not (= (at grid (first p) (second p)) 0))) (grid-positions grid)))) (if (empty? cells) (list (list 0)) (let* ((bb (bbox-of-cells cells)) (r0 (first bb)) (c0 (second bb)) (r1 (third bb)) (c1 (fourth bb))) (subgrid grid r0 c0 r1 c1))))) (define (paste-crop grid shape top left) (for*/fold ((out grid)) ((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 grid) (cols grid))) (set-cell out rr cc v) out)))) (define (transform-by-key shape key) (cond ((= key 1) (rotate-cw shape)) ((= key 2) (rotate-180 shape)) ((= key 3) (flip-lr shape)) ((= key 4) (transpose shape)) (else shape))) (define (pack-gallery shapes gap align) (let* ((h (if (empty? shapes) 1 (apply max (map rows shapes)))) (w (if (empty? shapes) 1 (+ (apply + (map cols shapes)) (* gap (max 0 (- (length shapes) 1))))))) (let loop ((remaining shapes) (left 0) (out (empty-grid h w 0))) (if (empty? remaining) out (let* ((shape (first remaining)) (top (cond ((equal? align 'top) 0) ((equal? align 'bottom) (- h (rows shape))) (else (quotient (- h (rows shape)) 2))))) (loop (rest remaining) (+ left (cols shape) gap) (paste-crop out shape top left))))))) (let* ((tl-key (at g 0 0)) (tr-key (at g 0 (- (cols g) 1))) (bl-key (at g (- (rows g) 1) 0)) (br-key (at g (- (rows g) 1) (- (cols g) 1))) (shape (crop-nonzero (set-cell (set-cell (set-cell (set-cell g 0 0 0) 0 (- (cols g) 1) 0) (- (rows g) 1) 0 0) (- (rows g) 1) (- (cols g) 1) 0))) (top (pack-gallery (list (transform-by-key shape tl-key) (transform-by-key shape tr-key)) 1 'top)) (bot (pack-gallery (list (transform-by-key shape bl-key) (transform-by-key shape br-key)) 1 'top)) (w (max (cols top) (cols bot))) (top2 (paste-crop (empty-grid (rows top) w 0) top 0 0)) (bot2 (paste-crop (empty-grid (rows bot) w 0) bot 0 0))) (append top2 (list (make-list w 0)) bot2))))
Provenance
- Generator
- generators/9f362acbf729/generator.py
- Notes and decisions
- generators/9f362acbf729/notes.md
- Review label
- reviewed_safe
- Generator SHA-256
- 80bc685311c0092f242c9500b79e8caeb502874d9f3ca93e2371cb9f6387d362
- Rule hash
- 75692873c100
- Sources
- bank:fc0f4ba66a95
- Lesson seeds
- 20261108, 20261109, 20261110, 20261111, 20261112
- Reproduce lesson 1
arcpuzzles generate 9f362acbf729 --count 1 --seed 20261108 --test 1