← 148cea0afb09 · 14dacb3b518f →

14c5c68b0201

One to three disjoint rectangular holes lie in a modal background. Each hole contains one sparse colored stamp and no other active color. For each stamp color independently, take the stamp's bounding-box pattern and repeat it by row/column modulo across the entire containing hole, using the stamp's original top-left as the phase origin.

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))
         ;; Most common color (the background)
         (bg (mode g 0))
         (colors (filter (lambda (c) (and (not (= c bg)) (not (= c 0))))
                         (grid-colors g))))
    (for/fold ((out g)) ((col colors))
      (let* ((cells (find-color g col))
             ;; Top edge of the bbox
             (sr1 (apply min (map first cells)))
             ;; Bottom edge of the bbox
             (sr2 (apply max (map first cells)))
             ;; Left edge of the bbox
             (sc1 (apply min (map second cells)))
             ;; Right edge of the bbox
             (sc2 (apply max (map second cells)))
             ;; Bbox height (rows)
             (sh (+ 1 (- sr2 sr1)))
             ;; Bbox width (cols)
             (sw (+ 1 (- sc2 sc1)))
             (hole-r1
              (let loop ((r sr1))
                (cond
                  ((<= r 0) 0)
                  ((for/and ((c (range sc1 (+ sc2 1))))
                     (let ((v (cell-at g (- r 1) c)))
                       (or (= v 0) (= v col))))
                   (loop (- r 1)))
                  (else r))))
             (hole-r2
              (let loop ((r sr2))
                (cond
                  ((>= (+ r 1) h) r)
                  ((for/and ((c (range sc1 (+ sc2 1))))
                     (let ((v (cell-at g (+ r 1) c)))
                       (or (= v 0) (= v col))))
                   (loop (+ r 1)))
                  (else r))))
             (hole-c1
              (let loop ((c sc1))
                (cond
                  ((<= c 0) 0)
                  ((for/and ((r (range sr1 (+ sr2 1))))
                     (let ((v (cell-at g r (- c 1))))
                       (or (= v 0) (= v col))))
                   (loop (- c 1)))
                  (else c))))
             (hole-c2
              (let loop ((c sc2))
                (cond
                  ((>= (+ c 1) w) c)
                  ((for/and ((r (range sr1 (+ sr2 1))))
                     (let ((v (cell-at g r (+ c 1))))
                       (or (= v 0) (= v col))))
                   (loop (+ c 1)))
                  (else c)))))
        (for*/fold ((o out))
                   ((r (range hole-r1 (+ hole-r2 1)))
                    (c (range hole-c1 (+ hole-c2 1))))
          (let* ((dr (modulo (- r sr1) sh))
                 (dc (modulo (- c sc1) sw))
                 (stamp-val (cell-at g (+ sr1 dr) (+ sc1 dc))))
            (cond
              ((= stamp-val col) (set-cell o r c col))
              (else o)))))))))

Provenance

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