← f9dd4cf0f344 · fa3550d200a0 →

fa2e57ec3fa2

Color-2 emitters cast color-7 beams rightward through zeros until any nonzero obstacle or the edge.

parametric familybeam tracingsame-size transformstraight-line projection

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 (turn v dr dc)
      (cond [(= v 6)
             (cond [(and (= dr 0) (= dc 1)) (list -1 0)]
                   [(and (= dr 0) (= dc -1)) (list 1 0)]
                   [(and (= dr -1) (= dc 0)) (list 0 1)]
                   [else (list 0 -1)])]
            [(= v 7)
             (cond [(and (= dr 0) (= dc 1)) (list 1 0)]
                   [(and (= dr 0) (= dc -1)) (list -1 0)]
                   [(and (= dr -1) (= dc 0)) (list 0 -1)]
                   [else (list 0 1)])]
            [else (list dr dc)]))
    (define (trace r c mirrors?)
      (let loop ([rr r] [cc c] [dr 0] [dc 1] [fuel (* (rows g) (cols g) 8)] [path (list)])
        (let ((nr (+ rr dr)) (nc (+ cc dc)))
          (cond [(or (= fuel 0) (not (in-bounds? nr nc (rows g) (cols g)))) (reverse path)]
                [(= (at g nr nc) 5) (reverse path)]
                [(and (not (= (at g nr nc) 0))
                      (not (and mirrors? (or (= (at g nr nc) 6) (= (at g nr nc) 7)))))
                 (reverse path)]
                [else
                 (let* ((v (at g nr nc))
                        (nd (turn v dr dc)))
                   (loop nr nc (first nd) (second nd) (- fuel 1) (cons (list nr nc) path)))]))))
    (for/fold ([out g]) ([seed (in-list (find-color g 2))])
      (for/fold ([acc out]) ([p (in-list (trace (first seed) (second seed) #f))])
        (if (= (at acc (first p) (second p)) 0)
            (set-cell acc (first p) (second p) 7)
            acc)))))

Provenance

Generator
generators/fa2e57ec3fa2/generator.py
Notes and decisions
generators/fa2e57ec3fa2/notes.md
Review label
reviewed_safe
Generator SHA-256
b8e4a14bcda793a34d57ad097db8b71843d37dfa67f34d13c93569de0fe00613
Rule hash
1eb5cb474942
Sources
bank:534c4be491a1
Lesson seeds
20261108, 20261109, 20261110, 20261111, 20261112
Reproduce lesson 1
arcpuzzles generate fa2e57ec3fa2 --count 1 --seed 20261108 --test 1