← public_eval_1818057f · public_eval_1ae2feb7 →

public_eval_195c6913

Decode a color sequence, follow corridor turns, and mark wall collisions.

parametric family

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!
 ;; Read the detached 2x2 swatches in reading order: a cyclic path sequence,
 ;; followed by a collision-marker swatch. Top-left gives the wall color;
 ;; the most frequent remaining color gives the traversable corridor.
 ;; Each left-edge seed alternates east and the declared vertical direction.
 ;; Mark the blocked forward cell, pivot at the last free cell, and preserve
 ;; sequence phase across turns. Stop at the canvas edge or a blocked new leg.
 ;; Erase the legend swatches; all routing uses the original input terrain.
 (lambda (g)
  (let ()
   (define vertical-step -1)
   (define wall (at g 0 0))
   (define colors (grid-colors g wall))
   (define road (if (null? colors) wall (pick-max colors (lambda (v) (count-color g v)))))
   (define swatches
    (filter (lambda (o) (and (not (= (obj-color o) road)) (= (obj-size o) 4)
                              (= (obj-h o) 2) (= (obj-w o) 2))) (objects g wall)))
   (if (< (length swatches) 3) g
    (let ()
     (define raw-pattern (map obj-color (take swatches (- (length swatches) 1))))
     (define pattern raw-pattern)
     (define marker (obj-color (last swatches)))
     (define starts (filter (lambda (r) (= (at g r 0) (first raw-pattern))) (range (rows g))))
     (define clean (for/fold ((out g)) ((o swatches))
                    (for/fold ((canvas out)) ((p (obj-cells o)))
                     (set-cell canvas (first p) (second p) wall))))
     (define (free? r c)
      (and (in-bounds? r c (rows g) (cols g)) (= (at g r c) road)))
     (define (walk out r c heading phase fuel)
      (let* ((painted (set-cell out r c (list-ref pattern (modulo phase (length pattern)))))
             (nr (if (= heading 0) r (+ r vertical-step)))
             (nc (if (= heading 0) (+ c 1) c)))
       (cond
        ((or (= fuel 0) (not (in-bounds? nr nc (rows g) (cols g)))) painted)
        ((free? nr nc) (walk painted nr nc heading (+ phase 1) (- fuel 1)))
        (else
         (let* ((marked (if (= (at g nr nc) wall) (set-cell painted nr nc marker) painted))
                (pc c)
                (next-heading (- 1 heading))
                (tr (if (= next-heading 0) r (+ r vertical-step)))
                (tc (if (= next-heading 0) (+ pc 1) pc)))
          (if (free? tr tc)
              (walk marked tr tc next-heading (+ phase 1) (- fuel 1)) marked))))))
     (for/fold ((out clean)) ((r starts))
      (walk out r 0 0 0 (* 2 (+ (rows g) (cols g))))))))))

Provenance

Generator
generators/public_eval_195c6913/generator.py
Notes and decisions
generators/public_eval_195c6913/notes.md
Review label
reviewed_safe
Generator SHA-256
6633448ecf640e872d158e2d813f85f1c7369f6df284f355e2a916f9bd7673b7
Rule hash
50ee7c603600
Sources
evaluation, public_eval:195c6913
Lesson seeds
20261108, 20261109, 20261110, 20261111, 20261112
Reproduce lesson 1
arcpuzzles generate public_eval_195c6913 --count 1 --seed 20261108 --test 1