← a0e364b16592 · a0ff437161da →
a0fcc6f3396e
Three corner-rectangle panels; return the unique completed shape in color 8.
double closureodd-one-out by normalized shapepanel parsing
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 (cell) (not (= (third cell) 0))) (grid-cells grid))) (define (pos-only cells) (map (lambda (cell) (list (first cell) (second cell))) cells)) (define (row-close cells) (remove-duplicates (flatmap (lambda (r) (let* ((cols (sort (map second (filter (lambda (p) (= (first p) r)) cells)) <))) (if (empty? cols) (list) (for/list ((c (in-range (first cols) (+ (last cols) 1)))) (list r c))))) (remove-duplicates (map first cells))))) (define (col-close cells) (remove-duplicates (flatmap (lambda (c) (let* ((rs (sort (map first (filter (lambda (p) (= (second p) c)) cells)) <))) (if (empty? rs) (list) (for/list ((r (in-range (first rs) (+ (last rs) 1)))) (list r c))))) (remove-duplicates (map second cells))))) (define (double-close cells) (col-close (row-close cells))) (define (crop-cells cells (color 8)) (let* ((bb (bbox-of-cells cells)) (r1 (first bb)) (c1 (second bb)) (r2 (third bb)) (c2 (fourth bb)) (norm (map (lambda (p) (list (- (first p) r1) (- (second p) c1))) cells))) (paint-cells (empty-grid (+ 1 (- r2 r1)) (+ 1 (- c2 c1)) 0) norm color))) (define (shape-key cells) (format "~a" (sort (normalize-cells cells) cell<))) (define (split-panels-9 grid) (define sep-cols (filter (lambda (c) (all? (lambda (r) (= (at grid r c) 9)) (range 0 (rows grid)))) (range 0 (cols grid)))) (define bounds (append (list -1) sep-cols (list (cols grid)))) (let loop ((xs bounds)) (if (empty? (rest xs)) (list) (let* ((left (+ (first xs) 1)) (right (- (second xs) 1)) (tail (loop (rest xs)))) (if (<= left right) (cons (subgrid grid 0 left (- (rows grid) 1) right) tail) tail))))) (let* ((panels (split-panels-9 g)) (infos (map (lambda (panel) (let* ((closed (double-close (pos-only (nonzero-cells panel)))) (key (shape-key closed))) (list key closed))) panels)) (keys (map first infos)) (odd (first (filter (lambda (info) (= (count-where (lambda (k) (equal? k (first info))) keys) 1)) infos)))) (crop-cells (second odd) 8))))
Provenance
- Generator
- generators/a0fcc6f3396e/generator.py
- Notes and decisions
- generators/a0fcc6f3396e/notes.md
- Review label
- reviewed_safe
- Generator SHA-256
- 20ca95cb86ac5682dec158411ede8f77347e6105922a731d612ea2f66cfe39fd
- Rule hash
- aadcb1545847
- Sources
- bank:129d068bbf4e
- Lesson seeds
- 20261108, 20261109, 20261110, 20261111, 20261112
- Reproduce lesson 1
arcpuzzles generate a0fcc6f3396e --count 1 --seed 20261108 --test 1