← ec491e97a5d5 · ec65f8d7bf45 →
ec5fd031b9e1
Build a color-8 bordered maze with interior wall dividers and one to three pairs of colored endpoints. Each pair remains connected when all walls and other endpoints are treated as blockers. The output paints the canonical shortest path for each color on the original maze.
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 colors (sort (filter (lambda (v) (and (not (= v 0)) (not (= v 8)))) (grid-colors g)) <))
(define (path-cells start goal)
(define parent (make-hash))
(define visited (mutable-set))
(define queue (list (cons (first start) (second start))))
(define goal-key (cons (first goal) (second goal)))
(define found #f)
(set-add! visited (first queue))
(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 (set-member? visited (cons nr nc)))
(or (= (at g nr nc) 0) (equal? (cons nr nc) goal-key)))
(set-add! visited (cons nr nc))
(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 start) (second start)))
next-acc
(trace (hash-ref parent cur) next-acc))))))
(for/fold ([out g]) ([color (in-list colors)])
(let ((pts (find-color g color)))
(if (= (length pts) 2)
(paint-cells out (path-cells (first pts) (second pts)) color)
out)))))Provenance
- Generator
- generators/ec5fd031b9e1/generator.py
- Notes and decisions
- generators/ec5fd031b9e1/notes.md
- Review label
- reviewed_safe
- Generator SHA-256
- 2935dc7c56f9b5bd6b8f0dcb8377171660d0686be80dec00866c2ca573d45570
- Rule hash
- 1fb88c73c536
- Sources
- bank:e57147319d67
- Lesson seeds
- 20261108, 20261109, 20261110, 20261111, 20261112
- Reproduce lesson 1
arcpuzzles generate ec5fd031b9e1 --count 1 --seed 20261108 --test 1