← public_eval_3dc255db · public_eval_409aa875 →

public_eval_3e6067c3

Read the detached color sequence, occurrence-match framed blocks, and connect consecutive aligned blocks.

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!
 ;; Detached singleton colors form an ordered route through solid framed blocks.
 ;; Match repeated colors to same-colored blocks in reading order. For each
 ;; consecutive aligned pair, fill the empty corridor at the payload thickness
 ;; using the departing block's payload color. Preserve blocks and legend.
 (lambda (g)
  (let ()
   (define bg (pick-max (grid-colors g) (lambda (v) (count-color g v))))
   (define frame
    (pick-max (filter (lambda (v) (not (= v bg))) (grid-colors g))
              (lambda (v) (count-color g v))))
   (define all-objects (objects-multicolor g bg))
   (define raw-blocks
    (sort (filter (lambda (o) (> (obj-size o) 1)) all-objects)
          (lambda (a b) (if (= (obj-r1 a) (obj-r1 b))
                            (< (obj-c1 a) (obj-c1 b))
                            (< (obj-r1 a) (obj-r1 b))))))
   (define legend
    (sort (filter (lambda (o) (= (obj-size o) 1)) all-objects)
          (lambda (a b) (if (= (obj-r1 a) (obj-r1 b))
                            (< (obj-c1 a) (obj-c1 b))
                            (< (obj-r1 a) (obj-r1 b))))))
   (define (block-data o)
    (define colors
     (remove-duplicates
      (map (lambda (p) (at g (first p) (second p))) (obj-cells o))))
    (define payload (first (filter (lambda (v) (not (= v frame))) colors)))
    (define payload-cells
     (filter (lambda (p) (= (at g (first p) (second p)) payload)) (obj-cells o)))
    (list payload (obj-r1 o) (obj-c1 o) (obj-r2 o) (obj-c2 o)
          (min-of first payload-cells) (min-of second payload-cells)
          (max-of first payload-cells) (max-of second payload-cells)))
   (define blocks (map block-data raw-blocks))
   (define sequence (map obj-color legend))
   (define route
    (for/list ((color sequence) (i (range (length sequence))))
     (define occurrence
      (count-if (lambda (v) (= v color)) (take sequence i)))
     (list-ref (filter (lambda (b) (= (first b) color)) blocks) occurrence)))
   (define (bridge-cells a b)
    (cond
     ((and (= (list-ref a 5) (list-ref b 5)) (= (list-ref a 7) (list-ref b 7)))
      (define lo (if (< (list-ref a 2) (list-ref b 2))
                     (+ (list-ref a 4) 1) (+ (list-ref b 4) 1)))
      (define hi (if (< (list-ref a 2) (list-ref b 2))
                     (list-ref b 2) (list-ref a 2)))
      (for*/list ((r (range (list-ref a 5) (+ (list-ref a 7) 1)))
                  (c (range lo hi))) (list r c)))
     ((and (= (list-ref a 6) (list-ref b 6)) (= (list-ref a 8) (list-ref b 8)))
      (define lo (if (< (list-ref a 1) (list-ref b 1))
                     (+ (list-ref a 3) 1) (+ (list-ref b 3) 1)))
      (define hi (if (< (list-ref a 1) (list-ref b 1))
                     (list-ref b 1) (list-ref a 1)))
      (for*/list ((r (range lo hi))
                  (c (range (list-ref a 6) (+ (list-ref a 8) 1)))) (list r c)))
     (else '())))
   (for/fold ((out g)) ((i (range (- (length route) 1))))
    (define a (list-ref route i))
    (define b (list-ref route (+ i 1)))
    (paint-cells out (bridge-cells a b) (first a))))))

Provenance

Generator
generators/public_eval_3e6067c3/generator.py
Notes and decisions
generators/public_eval_3e6067c3/notes.md
Review label
reviewed_safe
Generator SHA-256
012dea8cfff96fd71031a021687afdb62e4dc5e3a0bac6e5b9fe937e3fc1746b
Rule hash
23ad65f53a24
Sources
evaluation, public_eval:3e6067c3
Lesson seeds
20261108, 20261109, 20261110, 20261111, 20261112
Reproduce lesson 1
arcpuzzles generate public_eval_3e6067c3 --count 1 --seed 20261108 --test 1