← 1b7cbdffd485 · 1b9e8a54331b →

1b9d8370e28b

A 9..15 grid is split horizontally or vertically into cyan(8) and blue(1) regions. Three to five separated red(2) objects occur in both regions. Preserve each row's red count per region, compacting left in cyan and right in blue. A ragged connected object distinguishes this row-wise rule from rigidly sliding whole components.

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 ((tl (let loop ((c 0)) (if (!= (at g 0 c) 2) (at g 0 c) (loop (+ c 1))))))
             (let ((h-split (let loop
                                 ((r 1))
                                 (if (>= r h)
                                     #f
                                     (let ((curr (let lp
                                                      ((c 0))
                                                      (if (!= (at g r c) 2)
                                                          (at g r c)
                                                          (lp (+ c 1))))))
                                       (if (!= tl curr) r (loop (+ r 1)))))))
                   (v-split (let loop
                                 ((c 1))
                                 (if (>= c w)
                                     #f
                                     (let ((curr (let lp
                                                      ((r 0))
                                                      (if (!= (at g r c) 2)
                                                          (at g r c)
                                                          (lp (+ r 1))))))
                                       (if (!= tl curr) c (loop (+ c 1))))))))
               (define (bg-of r c)
                 (if h-split
                     (if (< r h-split) tl (if (= tl 8) 1 8))
                     (if (< c v-split) tl (if (= tl 8) 1 8))))
               (define (rc1 r c) (if v-split (if (< c v-split) 0 v-split) 0))
               (define (rc2 r c) (if v-split (if (< c v-split) v-split w) w))
               (define (red-count r reg-c1 reg-c2)
                 (let loop
                      ((c reg-c1) (cnt 0))
                      (if (>= c reg-c2)
                          cnt
                          (loop (+ c 1) (if (= (at g r c) 2) (+ cnt 1) cnt)))))
               (cellmap g
                        (r c v)
                        (let* ((bg (bg-of r c))
                               (c1 (rc1 r c))
                               (c2 (rc2 r c))
                               (cnt (red-count r c1 c2)))
                          (if (zero? cnt)
                              bg
                              (if (= bg 8)
                                  (if (< c (+ c1 cnt)) 2 bg)
                                  (if (>= c (- c2 cnt)) 2 bg))))))))))

Provenance

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