← 364829da8490 · 3696e3c9d426 →
366cda05b486
Find the unique blue (1) monochromatic object, follow cardinal contacts between differently coloured objects to its whole contact cluster, crop that union tightly, and recolour every selected cell cyan (8).
parametric familycropped uniongraph connected componentsseeded selection
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 (adjacent? grid a b) (any? (lambda (p) (any? (lambda (d) (member (list (+ (first p) (first d)) (+ (second p) (second d))) (obj-cells b))) cardinal-deltas)) (obj-cells a))) (define (neighbors grid objs i) (filter (lambda (j) (and (not (= i j)) (adjacent? grid (list-ref objs i) (list-ref objs j)))) (range 0 (length objs)))) (define (union-cells objs ids) (apply append (map (lambda (i) (obj-cells (list-ref objs i))) ids))) (define (extract-union grid objs ids color) (let* ((cells (union-cells objs ids)) (bb (bbox-of-cells cells)) (h (+ 1 (- (third bb) (first bb)))) (w (+ 1 (- (fourth bb) (second bb))))) (grid-from-fn h w (lambda (r c) (let ((p (list (+ (first bb) r) (+ (second bb) c)))) (if (member p cells) color 0)))))) (define (neighbors-in grid objs allowed i) (filter (lambda (j) (member j allowed)) (neighbors grid objs i))) (define (cluster-from grid objs start allowed) (let ((seen (make-hash))) (let bfs ((queue (list start)) (acc (list))) (if (empty? queue) (reverse acc) (let ((i (first queue))) (cond ((hash-has-key? seen i) (bfs (rest queue) acc)) ((not (member i allowed)) (bfs (rest queue) acc)) (else (hash-set! seen i #t) (bfs (append (rest queue) (neighbors-in grid objs allowed i)) (cons i acc))))))))) (define objs (objects g 0)) (define seed (first (filter (lambda (i) (= (obj-color (list-ref objs i)) 1)) (range 0 (length objs))))) (define cl (cluster-from g objs seed (range 0 (length objs)))) (extract-union g objs (sort cl <) 8)))
Provenance
- Generator
- generators/366cda05b486/generator.py
- Notes and decisions
- generators/366cda05b486/notes.md
- Review label
- reviewed_safe
- Generator SHA-256
- b1b4e08109b0dbf2893d6fb669467dcf6c52bc0060b8daf51064a1835bb03b53
- Rule hash
- f50313901f96
- Sources
- bank:3a1815be7c2e
- Lesson seeds
- 20261108, 20261109, 20261110, 20261111, 20261112
- Reproduce lesson 1
arcpuzzles generate 366cda05b486 --count 1 --seed 20261108 --test 1