← 04ec2218e2d8 · 05409de4bec8 →

053118990e92

The bounding box of color 8 defines a region; the 8s may be a full ring or only its four corners. Every non-zero, non-8 interior cell is a seed. Fill each interior cell with the Manhattan-nearest seed color. If nearest seeds have different colors, leave 0; if they share one color, fill it.

distance fieldsseed ownershiptie 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).

Original task pairs

From the source task; the reference rule must reproduce them.

Reference rule (Racket)

(rule!
  (let* ((bb (bbox-of-cells (find-color g 8)))
         (seeds (filter (lambda (cell)
                          (and (> (first cell) (first bb)) (< (first cell) (third bb))
                               (> (second cell) (second bb)) (< (second cell) (fourth bb))
                               (not (= (third cell) 0)) (not (= (third cell) 8))))
                        (grid-cells g))))
    (define (dist cell r c)
      (+ (abs (- r (first cell))) (abs (- c (second cell)))))
    (define (fill-value r c)
      (let* ((dmin (apply min (map (lambda (cell) (dist cell r c)) seeds)))
             (colors (remove-duplicates (map third (filter (lambda (cell) (= (dist cell r c) dmin)) seeds)))))
        (if (= (length colors) 1) (first colors) 0)))
    (for*/fold ([out g])
               ([r (in-range (+ (first bb) 1) (third bb))]
                [c (in-range (+ (second bb) 1) (fourth bb))])
      (if (= (at g r c) 8) out (set-cell out r c (fill-value r c))))))

Provenance

Generator
generators/053118990e92/generator.py
Notes and decisions
generators/053118990e92/notes.md
Review label
reviewed_safe
Generator SHA-256
894119384c9fb8dcad2199804ed001620049ef94de168c614c34fd2da0949a14
Rule hash
a2e9b991269f
Sources
bank:be1bc1d91387
Lesson seeds
20261108, 20261109, 20261110, 20261111, 20261112
Reproduce lesson 1
arcpuzzles generate 053118990e92 --count 1 --seed 20261108 --test 1