← b9e736518d82 · ba0c6a5828f9 →

ba090ac77d54

A rectangular grid has a closed one-cell gray (5) frame, zero interior background, and three or four distinct non-{0,5,8} seed colors. Fill each interior zero with the color of its uniquely nearest seed by Manhattan distance; if two or more seeds tie for the minimum distance, paint cyan (8). Preserve the seed cells and the gray frame.

distance reasoningregion partitioningtie handling

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 ((seeds (filter (lambda (cell) (not (member (third cell) (list 0 5))))
                       (grid-cells g))))
    (define (dist seed r c) (+ (abs (- (first seed) r)) (abs (- (second seed) c))))
    (grid-from-fn (rows g) (cols g)
      (lambda (r c)
        (if (not (= (at g r c) 0))
            (at g r c)
            (let* ((best (apply min (map (lambda (seed) (dist seed r c)) seeds)))
                   (hits (filter (lambda (seed) (= (dist seed r c) best)) seeds)))
              (if (= (length hits) 1) (third (first hits)) 8)))))))

Provenance

Generator
generators/ba090ac77d54/generator.py
Notes and decisions
generators/ba090ac77d54/notes.md
Review label
reviewed_safe
Generator SHA-256
8da308ca4f853a97266e21fbfd4e3e32e8c7b93104371b1fc7a3393b5de237ee
Rule hash
b8d93c3098e2
Sources
bank:64addfdad75c
Lesson seeds
20261108, 20261109, 20261110, 20261111, 20261112
Reproduce lesson 1
arcpuzzles generate ba090ac77d54 --count 1 --seed 20261108 --test 1