← e971e0773705 · e99db71ae23d →

e9905db3a38d

Two equal-size square templates (colors 1 and 2) sit above a two-row code grid. Codes 1/2 paste the templates, codes 3/4 paste clockwise rotations, and neighboring output tiles have a one-cell background gutter. A four-profile curriculum varies tile size and active code width while retaining 25% canonical-linked 3x3/three-column examples in every difficulty band.

code decodingrotationssize-changing outputtemplate tiling

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 (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 (s17b-object-crop grid obj) (let ((bb (obj-bbox obj))) (subgrid grid (first bb) (second bb) (third bb) (fourth bb)))) (define (t10-alist-ref pairs key default) (let ((hits (filter (lambda (p) (= (first p) key)) pairs))) (if (empty? hits) default (second (first hits))))) (let* ((top-area (subgrid g 0 0 (- (rows g) 3) (- (cols g) 1))) (code-grid (subgrid g (- (rows g) 2) 0 (- (rows g) 1) (- (cols g) 1))) (templates (map (lambda (obj) (list (obj-color obj) (s17b-object-crop top-area obj))) (objects top-area 0))) (tile-h (rows (second (first templates)))) (tile-w (cols (second (first templates)))) (nz-cols (filter (lambda (c) (any? (lambda (r) (not (= (at code-grid r c) 0))) (range (rows code-grid)))) (range (cols code-grid))))) (if (empty? nz-cols) (list (list 0)) (let* ((c0 (apply min nz-cols)) (c1 (apply max nz-cols)) (out-h (+ (* (rows code-grid) tile-h) (- (rows code-grid) 1))) (out-w (+ (* (+ 1 (- c1 c0)) tile-w) (- c1 c0)))) (for*/fold ((out (empty-grid out-h out-w 0))) ((rr (in-range (rows code-grid))) (cc (in-range (+ 1 (- c1 c0))))) (let ((code (at code-grid rr (+ c0 cc)))) (if (= code 0) out (let* ((tile (cond ((= code 1) (t10-alist-ref templates 1 #f)) ((= code 2) (t10-alist-ref templates 2 #f)) ((= code 3) (rotate-cw (t10-alist-ref templates 1 #f))) ((= code 4) (rotate-cw (t10-alist-ref templates 2 #f))) (else #f)))) (if tile (e8b-paste out tile (* rr (+ tile-h 1)) (* cc (+ tile-w 1))) out))))))))))

Provenance

Generator
generators/e9905db3a38d/generator.py
Notes and decisions
generators/e9905db3a38d/notes.md
Review label
reviewed_safe
Generator SHA-256
ebc2d78ae0c648e55b9f0ac70008b3d6c017e67f1ca8e8530e964289f4bb9ad8
Rule hash
7b04fc79d5f0
Sources
bank:ad4abc25f505
Lesson seeds
20261108, 20261109, 20261110, 20261111, 20261112
Reproduce lesson 1
arcpuzzles generate e9905db3a38d --count 1 --seed 20261108 --test 1