← 3c01bf0d6576 · 3ce95b466478 →

3c05b058b793

A black(0) grid contains exactly one red(2) seed, one green(3) seed, and optionally structured gray(5) walls. Run 4-connected shortest-path BFS through every non-wall cell from both seeds. Recolor each black cell cyan(8) when red is closer, yellow(4) when green is closer, and leave it black on an equal-distance tie. Seeds and walls remain unchanged. Normal lessons alternate an open witness with wall mazes whose detours make the BFS answer differ from a Manhattan-distance shortcut.

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* ((a (first (find-color g 2)))
         (b (first (find-color g 3))))
    (define (dist-from start)
      (define dist (make-hash))
      (define queue (list (cons (first start) (second start))))
      (hash-set! dist (first queue) 0)
      (let bfs ([fuel 0])
        (unless (empty? queue)
          (let ((cur (first queue)))
            (set! queue (rest queue))
            (for ([d (in-list cardinal-deltas)])
              (let ((nr (+ (car cur) (first d))) (nc (+ (cdr cur) (second d))))
                (when (and (in-bounds? nr nc (rows g) (cols g))
                           (not (= (at g nr nc) 5))
                           (not (hash-has-key? dist (cons nr nc))))
                  (hash-set! dist (cons nr nc) (+ (hash-ref dist cur) 1))
                  (set! queue (append queue (list (cons nr nc))))))))
          (bfs (+ fuel 1))))
      dist)
    (define da (dist-from a))
    (define db (dist-from b))
    (grid-from-fn (rows g) (cols g)
      (lambda (r c)
        (if (and (= (at g r c) 0)
                 (hash-has-key? da (cons r c))
                 (hash-has-key? db (cons r c)))
            (cond [(< (hash-ref da (cons r c)) (hash-ref db (cons r c))) 8]
                  [(< (hash-ref db (cons r c)) (hash-ref da (cons r c))) 4]
                  [else 0])
            (at g r c))))))

Provenance

Generator
generators/3c05b058b793/generator.py
Notes and decisions
generators/3c05b058b793/notes.md
Review label
reviewed_safe
Generator SHA-256
189386d9ccc9bf4518c2b1ae66a11a0466383530c9b0fc42194f6dad80f38ed2
Rule hash
58404f8e7c2f
Sources
bank:f4facb1306bd
Lesson seeds
20261108, 20261109, 20261110, 20261111, 20261112
Reproduce lesson 1
arcpuzzles generate 3c05b058b793 --count 1 --seed 20261108 --test 1