← 76b818438a96 · 77181d1aa16c →

76e0bd03e098

Three color pairs and 4-5 color-8 walls teach H-first preference, H-blocked/V-clear routing, both-blocked V fallback, wall preservation, and row-major overwrite order.

L-shaped routingobstacle avoidancepath finding

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 (between-inclusive a b) (if (<= a b) (range a (+ b 1)) (reverse (range b (+ a 1))))) (define (elbow-path p1 p2 first-dir) (let* ((r1 (first p1)) (c1 (second p1)) (r2 (first p2)) (c2 (second p2)) (cells (if (equal? first-dir 'h) (append (map (lambda (c) (list r1 c)) (between-inclusive c1 c2)) (map (lambda (r) (list r c2)) (rest (between-inclusive r1 r2)))) (append (map (lambda (r) (list r c1)) (between-inclusive r1 r2)) (map (lambda (c) (list r2 c)) (rest (between-inclusive c1 c2))))))) (remove-duplicates cells))) (define (path-clear-grid? grid cells endpoints) (all? (lambda (p) (and (in-bounds? (first p) (second p) (rows grid) (cols grid)) (or (member? p endpoints) (= (at grid (first p) (second p)) 0)))) cells)) (define (nonzero-colors-reading grid excluded) (let loop ((cells (grid-positions grid)) (seen (list)) (acc (list))) (if (empty? cells) (reverse acc) (let* ((p (first cells)) (v (at grid (first p) (second p)))) (if (or (= v 0) (member? v excluded) (member? v seen)) (loop (rest cells) seen acc) (loop (rest cells) (cons v seen) (cons v acc))))))) (for/fold ((out g)) ((color (in-list (nonzero-colors-reading g (list 8))))) (let ((pts (find-color g color))) (if (= (length pts) 2) (let* ((path-h (elbow-path (first pts) (second pts) 'h)) (path-v (elbow-path (first pts) (second pts) 'v)) (cells (if (path-clear-grid? g path-h pts) path-h path-v))) (for/fold ((acc out)) ((p (in-list cells))) (if (= (at acc (first p) (second p)) 8) acc (set-cell acc (first p) (second p) color)))) out)))))

Provenance

Generator
generators/76e0bd03e098/generator.py
Notes and decisions
generators/76e0bd03e098/notes.md
Review label
reviewed_safe
Generator SHA-256
20d16fff8241c881bc0b27ae62c2813dd88b083d27745af7eebd5860896db93a
Rule hash
43d5e3caf0e0
Sources
bank:9a1b04175c5a
Lesson seeds
20261108, 20261109, 20261110, 20261111, 20261112
Reproduce lesson 1
arcpuzzles generate 76e0bd03e098 --count 1 --seed 20261108 --test 1