← ad92d10d919c · ada3abda1b1d →

ad9405621c3d

Generate color-5 wall mazes containing exactly two matching colored endpoints. Four consecutive samples cover an edge-hugging route, a deep serpentine detour, an interior endpoint pair, and a multiple-shortest-path case. The authority paints the first U,D,L,R BFS shortest path through zero cells with the endpoint color.

parametric familyconnectivitymazepathfindingsame_size

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 dirs4 (list (list -1 0) (list 1 0) (list 0 -1) (list 0 1))) (define (paint grid cells color) (for/fold ((out grid)) ((p (in-list cells))) (if (in-bounds? (first p) (second p) (rows out) (cols out)) (set-cell out (first p) (second p) color) out))) (define (shortest-path grid start goal wall-colors) (let bfs ((queue (list (list start (list start)))) (seen (list start)) (fuel (* 4 (rows grid) (cols grid)))) (cond ((<= fuel 0) (list)) ((empty? queue) (list)) (else (let* ((item (first queue)) (cur (first item)) (path (second item))) (if (equal? cur goal) (reverse path) (let* ((nbrs (filter (lambda (p) (and (in-bounds? (first p) (second p) (rows grid) (cols grid)) (not (member? p seen)) (or (equal? p goal) (and (= (at grid (first p) (second p)) 0) (not (member? (at grid (first p) (second p)) wall-colors)))))) (map (lambda (d) (list (+ (first cur) (first d)) (+ (second cur) (second d)))) dirs4)))) (bfs (append (rest queue) (map (lambda (p) (list p (cons p path))) nbrs)) (append seen nbrs) (- fuel 1))))))))) (let* ((colors (filter (lambda (color) (= (length (find-color g color)) 2)) (grid-colors g 0))) (color (first colors)) (pts (find-color g color)) (path (shortest-path g (first pts) (second pts) (list 5)))) (paint g path color))))

Provenance

Generator
generators/ad9405621c3d/generator.py
Notes and decisions
generators/ad9405621c3d/notes.md
Review label
reviewed_safe
Generator SHA-256
390ee47af1dcb79f5aeb17c16a119cab7bc2e7c668be2ea9a5362b719e3a8126
Rule hash
f19a9c2c6081
Sources
bank:bc9ea2a8b0ce
Lesson seeds
20261108, 20261109, 20261110, 20261111, 20261112
Reproduce lesson 1
arcpuzzles generate ad9405621c3d --count 1 --seed 20261108 --test 1