← 36343a80035c · 366cda05b486 →
364829da8490
For each 4-connected color-0 region, fill it with its local surrounding color iff the region does not touch the canvas border and its cardinal boundary contains exactly one nonzero color. Open regions and enclosed regions with mixed-color boundaries remain unchanged.
enclosuresame_sizetopology
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 (neighbor-positions r c) (map (lambda (d) (list (+ r (first d)) (+ c (second d)))) cardinal-deltas)) (define seen (make-hash)) (define out g) (for* ((r (in-range (rows g))) (c (in-range (cols g)))) (when (and (= (at g r c) 0) (not (hash-has-key? seen (list r c)))) (define region (connected-region g r c (lambda (rr cc v) (= v 0)) 4)) (for ((p (in-list region))) (hash-set! seen p #t)) (define touches-border (any? (lambda (p) (or (= (first p) 0) (= (first p) (- (rows g) 1)) (= (second p) 0) (= (second p) (- (cols g) 1)))) region)) (define neigh-colors (remove-duplicates (filter (lambda (v) (not (= v 0))) (flatmap (lambda (p) (map (lambda (q) (at g (first q) (second q))) (filter (lambda (q) (in-bounds? (first q) (second q) (rows g) (cols g))) (neighbor-positions (first p) (second p))))) region)))) (when (and (not touches-border) (= (length neigh-colors) 1)) (set! out (paint-cells out region (first neigh-colors)))))) out))
Provenance
- Generator
- generators/364829da8490/generator.py
- Notes and decisions
- generators/364829da8490/notes.md
- Review label
- reviewed_safe
- Generator SHA-256
- 9e959ee0403be69176f40294a4bdd93f0bddfccd74f1c92f9da570f1ab10f3c6
- Rule hash
- c1200d217d20
- Sources
- bank:ecfb302aa617
- Lesson seeds
- 20261108, 20261109, 20261110, 20261111, 20261112
- Reproduce lesson 1
arcpuzzles generate 364829da8490 --count 1 --seed 20261108 --test 1