← 0f075657ddbb · 0f26224a6da3 →
0f25172eefa4
Crop the single body above the last row; read the ordered key cells; map 2/5 to identity, 3 to clockwise rotation, and 4 to 180-degree rotation; then h-stack the results with one-column gaps.
croppinggallery constructiontransform lookup
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-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 (n9b-apply-transform grid code) (cond ((or (= code 2) (= code 5)) grid) ((or (= code 3) (= code 6)) (rotate-cw grid)) ((= code 4) (rotate-180 grid)) ((= code 7) (flip-lr grid)) ((= code 8) (flip-ud grid)) (else grid))) (define (n9b-crop-nonzero grid) (crop-nonzero grid)) (let* ((keys (filter (lambda (v) (not (= v 0))) (last g))) (source (n9b-crop-nonzero (grid-from-fn (- (rows g) 1) (cols g) (lambda (r c) (at g r c))))) (parts (map (lambda (k) (n9b-apply-transform source k)) keys))) (f14b-hstack-center parts 1))))
Provenance
- Generator
- generators/0f25172eefa4/generator.py
- Notes and decisions
- generators/0f25172eefa4/notes.md
- Review label
- reviewed_safe
- Generator SHA-256
- 3d8e048c0a4dae89a8831c3e6a4b8cb4852b1625c61a366d59e252ab99d2f04f
- Rule hash
- 44e21d5003cc
- Sources
- bank:9f005a7005fe
- Lesson seeds
- 20261108, 20261109, 20261110, 20261111, 20261112
- Reproduce lesson 1
arcpuzzles generate 0f25172eefa4 --count 1 --seed 20261108 --test 1