← e8504fcc371b · e89e3ed7cb28 →

e87eeeaf7fc3

Construct a sparse connected graph inside gray walls, with either a tree topology or genuine alternate-route loops. Place red start 2, green checkpoint 3, and leaf goal 4 so both BFS segments are nontrivial and several traversable cells remain off the ordered route.

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 start (first (find-color g 2)))
    (define check (first (find-color g 3)))
    (define goal (first (find-color g 4)))
    (define (path a b)
      (define parent (make-hash))
      (define seen (make-hash))
      (define queue (list (cons (first a) (second a))))
      (define goal-key (cons (first b) (second b)))
      (define found #f)
      (hash-set! seen (first queue) #t)
      (let bfs ([step 0])
        (unless (or found (empty? queue))
          (let ((cur (first queue)))
            (set! queue (rest queue))
            (when (equal? cur goal-key) (set! found #t))
            (unless found
              (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 (hash-has-key? seen (cons nr nc)))
                             (not (= (at g nr nc) 5)))
                    (hash-set! seen (cons nr nc) #t)
                    (hash-set! parent (cons nr nc) cur)
                    (set! queue (append queue (list (cons nr nc)))))))))
          (bfs (+ step 1))))
      (if (not found)
          (list)
          (let trace ([cur goal-key] [acc (list)])
            (let ((next-acc (cons (list (car cur) (cdr cur)) acc)))
              (if (equal? cur (cons (first a) (second a)))
                  next-acc
                  (trace (hash-ref parent cur) next-acc))))))
    (let* ((base (grid-from-fn (rows g) (cols g) (lambda (r c) (if (= (at g r c) 5) 5 0))))
           (p (append (path start check) (path check goal))))
      (paint-cells base p 8))))

Provenance

Generator
generators/e87eeeaf7fc3/generator.py
Notes and decisions
generators/e87eeeaf7fc3/notes.md
Review label
reviewed_safe
Generator SHA-256
a4aabc9da748d45c6d42751fde7a1f1ef4783b41486f1c73c7a30cebdd7260cc
Rule hash
3c811e3e98bd
Sources
bank:4e772fa039b8
Lesson seeds
20261108, 20261109, 20261110, 20261111, 20261112
Reproduce lesson 1
arcpuzzles generate e87eeeaf7fc3 --count 1 --seed 20261108 --test 1