← dbecc530afd0 · dc050b56cac4 →
dbee38495261
A color-1 wall maze contains start 2, end 3, and one to four distinct waypoints from colors 4..7. Visit present waypoints in ascending numeric order between 2 and 3. For each leg, take the deterministic shortest four-neighbor path through non-wall cells (neighbor order up, down, left, right) and paint only path cells that were color 0 with color 8. Preserve all walls and markers.
ordered_targetspathfinding
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 positions (for/list ((color (in-list (filter (lambda (x) (not (empty? (find-color g x)))) (list 2 3 4 5 6 7))))) (list color (first (find-color g color))))) (define (pos color) (second (first (filter (lambda (x) (= (first x) color)) positions)))) (define mids (sort (filter (lambda (color) (and (not (= color 2)) (not (= color 3)))) (map first positions)) <)) (define order (append (list 2) mids (list 3))) (define (path-between src dst) (define queue (list src)) (define prev (make-hash)) (hash-set! prev src #f) (define (search) (unless (or (empty? queue) (hash-has-key? prev dst)) (define cur (first queue)) (set! queue (rest queue)) (for ((d (in-list cardinal-deltas))) (define nr (+ (first cur) (first d))) (define nc (+ (second cur) (second d))) (define p (list nr nc)) (when (and (in-bounds? nr nc (rows g) (cols g)) (not (= (at g nr nc) 1)) (not (hash-has-key? prev p))) (hash-set! prev p cur) (set! queue (append queue (list p))))) (search))) (search) (if (not (hash-has-key? prev dst)) (list) (let rebuild ((cur dst) (acc (list))) (if (eq? cur #f) acc (rebuild (hash-ref prev cur #f) (cons cur acc)))))) (let loop ((colors order) (out g)) (if (empty? (rest colors)) out (let ((path (path-between (pos (first colors)) (pos (second colors))))) (loop (rest colors) (for/fold ((acc out)) ((p (in-list (if (< (length path) 2) (list) (take (rest path) (max 0 (- (length path) 2))))))) (if (= (at acc (first p) (second p)) 0) (set-cell acc (first p) (second p) 8) acc))))))))
Provenance
- Generator
- generators/dbee38495261/generator.py
- Notes and decisions
- generators/dbee38495261/notes.md
- Review label
- reviewed_safe
- Generator SHA-256
- b7a091c114eece1357ceac46e64a6d915564d3f618699aaae7be999862c8907d
- Rule hash
- f1fa88aeec11
- Sources
- bank:037ff40eee92
- Lesson seeds
- 20261108, 20261109, 20261110, 20261111, 20261112
- Reproduce lesson 1
arcpuzzles generate dbee38495261 --count 1 --seed 20261108 --test 1