← 9fbd0923e6ae · 9fe97c2dd8a4 →

9fc0b6db96fe

Read the transform key at (0,0) and the ordered nonzero legend across row 0. For each legend color, crop its body component, apply the shared key, and pack the transformed crops into a one-row gallery in legend order.

parametric familygallery synthesisselection by legendshared transform key

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 dirs4 (list (list -1 0) (list 1 0) (list 0 -1) (list 0 1))) (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 (e5b-nz-components grid) (let loop-pos ((positions (grid-positions grid)) (seen (list)) (acc (list))) (cond ((empty? positions) (reverse acc)) ((or (member? (first positions) seen) (= (at grid (first (first positions)) (second (first positions))) 0)) (loop-pos (rest positions) seen acc)) (else (let bfs ((queue (list (first positions))) (seen2 (cons (first positions) seen)) (cells (list))) (if (empty? queue) (loop-pos (rest positions) seen2 (cons (reverse cells) acc)) (let* ((cur (first queue)) (nbrs (filter (lambda (p) (and (in-bounds? (first p) (second p) (rows grid) (cols grid)) (not (member? p seen2)) (not (= (at grid (first p) (second p)) 0)))) (map (lambda (d) (list (+ (first cur) (first d)) (+ (second cur) (second d)))) dirs4)))) (bfs (append (rest queue) nbrs) (append seen2 nbrs) (cons cur cells))))))))) (define (s17b-gallery-row objs (gap 1)) (if (empty? objs) (list (list 0)) (let* ((h (apply max (map rows objs))) (w (+ (apply + (map cols objs)) (* gap (- (length objs) 1))))) (let loop ((rest-objs objs) (left 0) (out (empty-grid h w 0))) (if (empty? rest-objs) out (let ((obj (first rest-objs))) (loop (rest rest-objs) (+ left (cols obj) gap) (e8b-paste out obj 0 left)))))))) (define (s6-component-grid grid cells) (let ((bb (bbox-of-cells cells))) (grid-from-fn (+ 1 (- (third bb) (first bb))) (+ 1 (- (fourth bb) (second bb))) (lambda (r c) (let ((rr (+ (first bb) r)) (cc (+ (second bb) c))) (if (member? (list rr cc) cells) (at grid rr cc) 0)))))) (define (s6b-component-crop grid cells) (s6-component-grid grid cells)) (define (s6b-transform-key grid key) (cond ((= key 1) grid) ((= key 2) (rotate-cw grid)) ((= key 3) (rotate-180 grid)) ((= key 4) (flip-lr grid)) (else grid))) (let* ((key (at g 0 0)) (legend (filter (lambda (v) (not (= v 0))) (rest (first g)))) (body (subgrid g 2 0 (- (rows g) 1) (- (cols g) 1))) (parts (for/list ((color (in-list legend))) (let ((crop (s6b-component-crop body (first (filter (lambda (comp) (= (at body (first (first comp)) (second (first comp))) color)) (e5b-nz-components body)))))) (s6b-transform-key crop key))))) (s17b-gallery-row parts 1))))

Provenance

Generator
generators/9fc0b6db96fe/generator.py
Notes and decisions
generators/9fc0b6db96fe/notes.md
Review label
reviewed_safe
Generator SHA-256
fe39314e07c4a466c482a6f37f052a404c7f11220840e998d8f748e02ad56c96
Rule hash
0235d1a8fb27
Sources
bank:529ce7614691
Lesson seeds
20261108, 20261109, 20261110, 20261111, 20261112
Reproduce lesson 1
arcpuzzles generate 9fc0b6db96fe --count 1 --seed 20261108 --test 1