← c130e51c4310 · c1ae510562f9 →

c181f41a09f0

On a literal orange-7 canvas, two to four parallel full-span black strips are exactly three cells thick. One to three strips carry a same-colored cap in the three-wide block at a common source end, while at least one strip is unmarked and inherits that direction. Clear every strip and copy its complete source-end 3-wide block to the opposite end. Same-colored markers outside all strips are stationary decoys.

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! (lambda (g)
         (let* ((h (rows g))
                (w (cols g)))
           (let* ((bg 7)
                  (zero-comps (filter (lambda (obj)
                                        (and
                                          (zero? (obj-color obj))
                                          (let* ((hh (+ 1 (- (obj-r2 obj) (obj-r1 obj))))
                                                 (ww (+ 1 (- (obj-c2 obj) (obj-c1 obj)))))
                                            (and (>= (max hh ww) 6) (<= (min hh ww) 3)))))
                                      (objects g bg))))
             (define (score-rect r1 c1 r2 c2)
               (for*/sum ((r (range r1 (+ r2 1))) (c (range c1 (+ c2 1))))
                         (let ((v (at g r c))) (if (and (!= v 0) (!= v bg)) 1 0))))
             (define (horizontal? obj)
               (>= (+ 1 (- (obj-c2 obj) (obj-c1 obj)))
                   (+ 1 (- (obj-r2 obj) (obj-r1 obj)))))
             (define (hdir obj)
               (let* ((r1 (obj-r1 obj))
                      (r2 (obj-r2 obj))
                      (c1 (obj-c1 obj))
                      (c2 (obj-c2 obj))
                      (left (score-rect r1 c1 r2 (+ c1 2)))
                      (right (score-rect r1 (- c2 2) r2 c2)))
                 (cond ((> left right) 0) ((> right left) 1) (else #f))))
             (define (vdir obj)
               (let* ((r1 (obj-r1 obj))
                      (r2 (obj-r2 obj))
                      (c1 (obj-c1 obj))
                      (c2 (obj-c2 obj))
                      (top (score-rect r1 c1 (+ r1 2) c2))
                      (bottom (score-rect (- r2 2) c1 r2 c2)))
                 (cond ((> top bottom) 0) ((> bottom top) 1) (else #f))))
             (define hfb
               (let ((dirs (filter (lambda (x) (not (eq? x #f)))
                                   (map hdir (filter horizontal? zero-comps)))))
                 (if (null? dirs) 0 (mode-list dirs))))
             (define vfb
               (let ((dirs (filter (lambda (x) (not (eq? x #f)))
                                   (map vdir
                                        (filter (lambda (obj) (not (horizontal? obj)))
                                                zero-comps)))))
                 (if (null? dirs) 0 (mode-list dirs))))
             (define (copy-block acc sr sc dr dc nr nc)
               (reduce (lambda (a p)
                         (let* ((rr (first p))
                                (cc (second p))
                                (tr (+ dr (- rr sr)))
                                (tc (+ dc (- cc sc))))
                           (set-cell a tr tc (at g rr cc))))
                       acc
                       (positions-in-rect sr sc (+ sr (- nr 1)) (+ sc (- nc 1)))))
             (define (process acc obj)
               (let* ((r1 (obj-r1 obj))
                      (c1 (obj-c1 obj))
                      (r2 (obj-r2 obj))
                      (c2 (obj-c2 obj))
                      (hh (+ 1 (- r2 r1)))
                      (ww (+ 1 (- c2 c1)))
                      (cleared (paint-cells acc (positions-in-rect r1 c1 r2 c2) bg)))
                 (if (horizontal? obj)
                     (let* ((d (let ((x (hdir obj))) (if (eq? x #f) hfb x)))
                            (src-c (if (zero? d) c1 (- c2 2)))
                            (dst-c (if (zero? d) (- c2 2) c1)))
                       (copy-block cleared r1 src-c r1 dst-c hh 3))
                     (let* ((d (let ((x (vdir obj))) (if (eq? x #f) vfb x)))
                            (src-r (if (zero? d) r1 (- r2 2)))
                            (dst-r (if (zero? d) (- r2 2) r1)))
                       (copy-block cleared src-r c1 dst-r c1 3 ww)))))
             (reduce process g zero-comps)))))

Provenance

Generator
generators/c181f41a09f0/generator.py
Notes and decisions
generators/c181f41a09f0/notes.md
Review label
reviewed_safe
Generator SHA-256
fdaef0b9eb49b55dd60c29589e8f5fca51519fe52b3357ab2f146234fdd7eba0
Rule hash
bd986c826aae
Sources
augmented, training
Lesson seeds
20261108, 20261109, 20261110, 20261111, 20261112
Reproduce lesson 1
arcpuzzles generate c181f41a09f0 --count 1 --seed 20261108 --test 1