← 66e63986855b · 6737eb62cf42 →
671a9af906aa
In a color-8 maze, find the shortest route from start 2 to goal 3 in (position, has-key) state space. Color 4 grants the key needed to enter door 5. Paint only traversed zero cells 7; preserve markers, and leave the grid unchanged when the goal is unreachable.
key_doormazepathfindingstate
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 goal (first (find-color g 3)))
(define keys (find-color g 4))
(define doors (find-color g 5))
(define walls (find-color g 8))
(define queue (list (list (first start) (second start) #f)))
(define prev (make-hash))
(define goal-state #f)
(hash-set! prev (first queue) #f)
(define (search)
(unless (or (empty? queue) goal-state)
(let* ((cur (first queue))
(r (first cur))
(c (second cur))
(has-key (third cur)))
(set! queue (rest queue))
(if (and (= r (first goal)) (= c (second goal)))
(set! goal-state cur)
(for ([d (in-list cardinal-deltas)])
(let* ((nr (+ r (first d)))
(nc (+ c (second d)))
(new-key (or has-key (member (list nr nc) keys)))
(st (list nr nc new-key)))
(when (and (in-bounds? nr nc (rows g) (cols g))
(not (member (list nr nc) walls))
(or new-key (not (member (list nr nc) doors)))
(not (hash-has-key? prev st)))
(hash-set! prev st cur)
(set! queue (append queue (list st)))))))
(search))))
(search)
(define path
(if goal-state
(let rebuild ([cur goal-state] [acc (list)])
(if (eq? cur #f)
acc
(rebuild (hash-ref prev cur #f) (cons (list (first cur) (second cur)) acc))))
(list)))
(for/fold ([out g]) ([p (in-list path)])
(let ((v (at out (first p) (second p))))
(if (member v (list 2 3 4 5 8))
out
(set-cell out (first p) (second p) 7))))))Provenance
- Generator
- generators/671a9af906aa/generator.py
- Notes and decisions
- generators/671a9af906aa/notes.md
- Review label
- reviewed_safe
- Generator SHA-256
- d8f73a03d424429172711492b4c6251cc82ac2adecc6f8fa28f81e004392095a
- Rule hash
- 09280085884a
- Sources
- bank:d7b013a675b4
- Lesson seeds
- 20261108, 20261109, 20261110, 20261111, 20261112
- Reproduce lesson 1
arcpuzzles generate 671a9af906aa --count 1 --seed 20261108 --test 1