← c8138b7e476c · c831492f416e →
c830d527a4ba
Extract the color-1 template. Replace each code-grid cell by a recolored template transform: 2 = identity, 3 = 90° clockwise, 4 = 180°, and 5 = horizontal flip; preserve zero code gaps and center tiles with one-cell spacing.
mosaic constructionrecoloringtemplate extractiontransform 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 (f14b-vstack-center grids (gap 1)) (if (empty? grids) (list (list)) (let* ((w (apply max (map cols grids))) (h (+ (apply + (map rows grids)) (* gap (- (length grids) 1))))) (let loop ((ys grids) (top 0) (out (empty-grid h w 0))) (if (empty? ys) out (let* ((piece (first ys)) (left (quotient (- w (cols piece)) 2))) (loop (rest ys) (+ top (rows piece) gap) (e8b-paste out piece top left)))))))) (define (f4b-recolor-nonzero grid color) (grid-from-fn (rows grid) (cols grid) (lambda (r c) (if (= (at grid r c) 0) 0 color)))) (define (n9b-crop-nonzero grid) (crop-nonzero grid)) (let* ((source (n9b-crop-nonzero (grid-from-fn (rows g) (cols g) (lambda (r c) (if (= (at g r c) 1) 1 0))))) (code-cells (filter (lambda (p) (member? (at g (first p) (second p)) (list 2 3 4 5))) (grid-positions g))) (bb (bbox-of-cells code-cells)) (code-grid (grid-from-fn (+ 1 (- (third bb) (first bb))) (+ 1 (- (fourth bb) (second bb))) (lambda (r c) (let ((v (at g (+ (first bb) r) (+ (second bb) c)))) (if (member? v (list 2 3 4 5)) v 0))))) (rows-out (for/list ((r (in-range (rows code-grid)))) (f14b-hstack-center (for/list ((c (in-range (cols code-grid)))) (let ((code (at code-grid r c))) (if (= code 0) (empty-grid (rows source) (cols source) 0) (f4b-recolor-nonzero (cond ((= code 2) source) ((= code 3) (rotate-cw source)) ((= code 4) (rotate-180 source)) (else (flip-lr source))) code)))) 1)))) (f14b-vstack-center rows-out 1))))
Provenance
- Generator
- generators/c830d527a4ba/generator.py
- Notes and decisions
- generators/c830d527a4ba/notes.md
- Review label
- reviewed_safe
- Generator SHA-256
- de31633eee9869865f8a05d5dd6f75049d323badc00502d4d52448d31d44300e
- Rule hash
- 0b137f4534ae
- Sources
- bank:9f005a7005fe
- Lesson seeds
- 20261108, 20261109, 20261110, 20261111, 20261112
- Reproduce lesson 1
arcpuzzles generate c830d527a4ba --count 1 --seed 20261108 --test 1