← d2534264df36 · d2a80a6f9495 →
d2708f8b731b
Use the left prototype-to-swatch legend to recolor every shape-matching neutral target on the right of the central blank separator.
parametric familylegend parsingshape matchingsymbol-grounded recolor
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).
Reference rule (Racket)
(rule! (let ((dummy 0)) (define (norm-cells cells) (sort (normalize-cells cells) cell<)) (define (last-list xs) (if (empty? (rest xs)) (first xs) (last-list (rest xs)))) (define (objs-color grid color) (filter (lambda (obj) (= (obj-color obj) color)) (objects grid 0))) (define (paint-obj grid obj color) (paint-cells grid (obj-cells obj) color)) (define (col-all-zero? grid c) (all? (lambda (r) (= (at grid r c) 0)) (range 0 (rows grid)))) (define (col-left-nonzero? grid c) (any? (lambda (r) (any? (lambda (cc) (not (= (at grid r cc) 0))) (range 0 c))) (range 0 (rows grid)))) (define (col-right-nonzero? grid c) (any? (lambda (r) (any? (lambda (cc) (not (= (at grid r cc) 0))) (range (+ c 1) (cols grid)))) (range 0 (rows grid)))) (define (choose-sep-col grid) (let* ((cands (filter (lambda (c) (and (col-all-zero? grid c) (col-left-nonzero? grid c) (col-right-nonzero? grid c))) (range 0 (cols grid))))) (first (sort cands (lambda (a b) (let ((da (abs (- (* 2 a) (cols grid)))) (db (abs (- (* 2 b) (cols grid))))) (if (= da db) (< a b) (< da db)))))))) (define (sample-right-of-shape grid obj sep) (let* ((r1 (obj-r1 obj)) (r2 (obj-r2 obj)) (c2 (obj-c2 obj)) (hits (filter (lambda (v) (not (member? v (list 0 1)))) (for*/list ((r (in-range (max 0 (- r1 1)) (min (rows grid) (+ r2 2)))) (c (in-range (+ c2 1) sep))) (at grid r c))))) (if (empty? hits) #f (last-list hits)))) (let* ((sep (choose-sep-col g)) (left-objs (filter (lambda (obj) (< (obj-c2 obj) sep)) (objs-color g 1))) (mapping (map (lambda (obj) (list (norm-cells (obj-cells obj)) (sample-right-of-shape g obj sep))) left-objs))) (for/fold ((out g)) ((obj (in-list (filter (lambda (o) (> (obj-c1 o) sep)) (objs-color g 1))))) (let* ((shape (norm-cells (obj-cells obj))) (hit (filter (lambda (row) (equal? (first row) shape)) mapping)) (color (if (empty? hit) 1 (second (first hit))))) (paint-obj out obj color))))))
Provenance
- Generator
- generators/d2708f8b731b/generator.py
- Notes and decisions
- generators/d2708f8b731b/notes.md
- Review label
- reviewed_safe
- Generator SHA-256
- 62ace6019082ae7960841070bab7aae1bd9cf7c420762bcc795e1b7761458cdb
- Rule hash
- a1f334053a9e
- Sources
- bank:b87bafc16aa7
- Lesson seeds
- 20261108, 20261109, 20261110, 20261111, 20261112
- Reproduce lesson 1
arcpuzzles generate d2708f8b731b --count 1 --seed 20261108 --test 1