← 126da449328f · 12a886996b14 →
127f5b19efc1
Place one multicolor connected template above a bottom strip of exactly four transform keys. Smaller isolated cells may distract from the main object, so the unique largest component is selected. Read the four keys left-to-right (repeats are meaningful), apply id/cw90/180/flip-lr, and top-left align the four crops in a 2x2 gallery separated by zeros.
keyed transformationspanel assemblytemplate extraction
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 (e5b-crop-cells grid cells) (let ((bb (bbox-of-cells cells))) (subgrid grid (first bb) (second bb) (third bb) (fourth bb)))) (define (e5b-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* ((keys (filter (lambda (v) (member? v (list 1 2 3 4))) (last g))) (work (grid-from-fn (rows g) (cols g) (lambda (r c) (if (and (= r (- (rows g) 1)) (member? (at g r c) (list 1 2 3 4))) 0 (at g r c))))) (template (e5b-crop-cells work (first (sort (e5b-nz-components work) (lambda (a b) (> (length a) (length b))))))) (trans (map (lambda (k) (e5b-transform-key template k)) keys)) (cell-h (apply max (map rows trans))) (cell-w (apply max (map cols trans))) (positions (list (list 0 0) (list 0 (+ cell-w 1)) (list (+ cell-h 1) 0) (list (+ cell-h 1) (+ cell-w 1))))) (let loop ((xs trans) (ps positions) (out (empty-grid (+ (* 2 cell-h) 1) (+ (* 2 cell-w) 1) 0))) (if (or (empty? xs) (empty? ps)) out (loop (rest xs) (rest ps) (e8b-paste out (first xs) (first (first ps)) (second (first ps)))))))))
Provenance
- Generator
- generators/127f5b19efc1/generator.py
- Notes and decisions
- generators/127f5b19efc1/notes.md
- Review label
- reviewed_safe
- Generator SHA-256
- 587d811c108d38e56fe634802d077ebca7f94b7ae72d7e697da2403aa04b9fe9
- Rule hash
- 692baf483e4b
- Sources
- bank:61554c4a7bfb
- Lesson seeds
- 20261108, 20261109, 20261110, 20261111, 20261112
- Reproduce lesson 1
arcpuzzles generate 127f5b19efc1 --count 1 --seed 20261108 --test 1