← b86607f34b8b · b88894a36787 →

b87dcd3011b1

An 8..30 rectangular maze has one start(2), one goal(3), a complete gray wall barrier(8), one to three paired portals colored 4/5/6, and up to eight extra walls. Start and goal lie on opposite sides and no ordinary route crosses the barrier; at least one portal pair is required.

parametric familymazepathfindingportals

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 (portal-exit p) (let ((v (at g (first p) (second p)))) (if (member? v (list 4 5 6)) (let ((others (filter (lambda (q) (not (equal? q p))) (find-color g v)))) (if (empty? others) p (first others))) p))) (define queue (list start)) (define prev (make-hash)) (hash-set! prev start #f) (define (search) (unless (or (empty? queue) (hash-has-key? prev goal)) (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))) (when (and (in-bounds? nr nc (rows g) (cols g)) (not (= (at g nr nc) 8))) (define nxt (portal-exit (list nr nc))) (when (not (hash-has-key? prev nxt)) (hash-set! prev nxt cur) (set! queue (append queue (list nxt)))))) (search))) (search) (if (not (hash-has-key? prev goal)) g (let ((path (let rebuild ((cur goal) (acc (list))) (if (eq? cur #f) acc (rebuild (hash-ref prev cur #f) (cons cur acc)))))) (for/fold ((out g)) ((p (in-list path))) (if (= (at out (first p) (second p)) 0) (set-cell out (first p) (second p) 7) out))))))

Provenance

Generator
generators/b87dcd3011b1/generator.py
Notes and decisions
generators/b87dcd3011b1/notes.md
Review label
reviewed_safe
Generator SHA-256
f41168a17b07a916c8417e07b76701749246fa722c157445a427a11b01bf6843
Rule hash
0cc1f5e794c7
Sources
bank:ecfb302aa617
Lesson seeds
20261108, 20261109, 20261110, 20261111, 20261112
Reproduce lesson 1
arcpuzzles generate b87dcd3011b1 --count 1 --seed 20261108 --test 1