← a5e17b975ae0 · a6211f2301a7 →

a61246736c26

Use each column's solid swatch row and fill to recolor its duplicated 1/2/8 pattern tile.

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! (lambda (g) (let* ((h (rows g)) (w (cols g))) (begin (define (sep-row? r) (all? (lambda (c) (= (at g r c) 8)) (range 0 w))) (define (sep-col? c) (all? (lambda (r) (= (at g r c) 8)) (range 0 h))) (define (bands seps end) (let loop ((xs seps) (prev 0) (acc (list))) (if (null? xs) (reverse (if (< prev end) (cons (list prev (- end 1)) acc) acc)) (let* ((s (first xs))) (loop (rest xs) (+ s 1) (if (> s prev) (cons (list prev (- s 1)) acc) acc)))))) (define row-bands (bands (filter sep-row? (range 0 h)) h)) (define col-bands (bands (filter sep-col? (range 0 w)) w)) (define n (+ 1 (- (second (first row-bands)) (first (first row-bands))))) (define row-colors (map (lambda (rb) (at g (first rb) (first (first col-bands)))) row-bands)) (define (tile-core ri ci) (let* ((rb (list-ref row-bands ri)) (cb (list-ref col-bands ci)) (c0 (if (zero? ci) (+ (first cb) 1) (first cb)))) (subgrid g (first rb) c0 (second rb) (second cb)))) (define (flat-values tile) (flatmap (lambda (r) (map (lambda (c) (at tile r c)) (range 0 n))) (range 0 n))) (define (interior-non-frame tile) (filter (lambda (v) (!= v 1)) (flatmap (lambda (r) (map (lambda (c) (at tile r c)) (range 1 (- n 1)))) (range 1 (- n 1))))) (define (solid-color tile) (let* ((vals (interior-non-frame tile)) (u (unique vals))) (and (and (not (null? vals)) (= (length u) 1)) (first u)))) (define (pattern? tile) (let* ((vals (flat-values tile))) (and (member? 2 vals) (member? 8 vals)))) (define (output-tile ci) (let* ((infos (map (lambda (ri) (let* ((t (tile-core ri ci)) (sc (solid-color t))) (list ri sc t))) (range 0 (length row-bands)))) (solid (find-first (lambda (x) (and (second x) (!= (second x) 2) (!= (second x) 8))) infos)) (fill (second solid)) (frame (list-ref row-colors (first solid))) (pattern-info (find-first (lambda (x) (pattern? (third x))) infos)) (pat (third pattern-info))) (cellmap pat (r c v) (casev v (hash 1 frame 2 fill) v)))) (let* ((num-cols (length col-bands)) (outw (+ (* num-cols n) (- num-cols 1))) (tiles (map output-tile (range 0 num-cols)))) (build-grid n outw (r c) (if (= (modulo c (+ n 1)) n) 8 (at (list-ref tiles (quotient c (+ n 1))) r (modulo c (+ n 1))))))))))

Provenance

Generator
generators/a61246736c26/generator.py
Notes and decisions
generators/a61246736c26/notes.md
Review label
reviewed_safe
Generator SHA-256
b32f4411f071041b98d3108b0a85fe948eabe607038faa663e47f2357fa3da14
Rule hash
08238424436c
Sources
training
Lesson seeds
20261108, 20261109, 20261110, 20261111, 20261112
Reproduce lesson 1
arcpuzzles generate a61246736c26 --count 1 --seed 20261108 --test 1