← 78806e443729 · 78ab57735469 →

78a914ac492e

A non-rectangular two-color template (common cell + accent L) plus 1-3 rectangular seeds (2x2 common block + 2x1 new-color block), placed at random separated positions on a random-sized grid. The rule scales the template at each seed, replacing the accent with the seed's new color.

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* ((objs (objects-multicolor g 0))
                (cell-color (lambda (p) (at g (fst p) (snd p))))
                (is-rect-color (lambda (cells color)
                                 (let* ((cc (filter (lambda (p)
                                                      (= color (cell-color p)))
                                                    cells))
                                        (n (length cc)))
                                   (if (zero? n)
                                       #t
                                       (let ((bb (bbox-of-cells cc)))
                                         (= n
                                            (* (+ 1 (- (third bb) (first bb)))
                                               (+ 1 (- (fourth bb) (second bb))))))))))
                (is-seed (lambda (obj)
                           (let* ((cells (obj-cells obj))
                                  (colors (unique (map cell-color cells))))
                             (and
                               (<= (length colors) 2)
                               (all? (lambda (c) (is-rect-color cells c)) colors)))))
                (template (find-first (lambda (o) (not (is-seed o))) objs))
                (seeds (filter is-seed objs))
                (t-cells (obj-cells template))
                (t-colors (unique (map cell-color t-cells)))
                (t-mnr (min-of fst t-cells))
                (t-mnc (min-of snd t-cells))
                (apply-seed (lambda (out seed)
                              (let* ((s-cells (obj-cells seed))
                                     (s-colors (unique (map cell-color s-cells)))
                                     (common (find-first (lambda (c)
                                                           (member? c s-colors))
                                                         t-colors))
                                     (t-other (find-first (lambda (c) (!= c common))
                                                          t-colors))
                                     (new-color (find-first (lambda (c) (!= c common))
                                                            s-colors))
                                     (s-common-cells (filter (lambda (p)
                                                               (= common (cell-color p)))
                                                             s-cells))
                                     (scb (bbox-of-cells s-common-cells))
                                     (sc-mnr (first scb))
                                     (sc-mnc (second scb))
                                     (sc-mxr (third scb))
                                     (sc-mxc (fourth scb))
                                     (sc-h (+ 1 (- sc-mxr sc-mnr)))
                                     (sc-w (+ 1 (- sc-mxc sc-mnc)))
                                     (t-common-cells (filter (lambda (p)
                                                               (= common (cell-color p)))
                                                             t-cells))
                                     (tcb (bbox-of-cells t-common-cells))
                                     (tc-mnr (first tcb))
                                     (tc-mnc (second tcb))
                                     (tc-mxr (third tcb))
                                     (tc-mxc (fourth tcb))
                                     (tc-h (+ 1 (- tc-mxr tc-mnr)))
                                     (tc-w (+ 1 (- tc-mxc tc-mnc)))
                                     (scale (let ((sh (/ sc-h tc-h))
                                                  (sw (/ sc-w tc-w)))
                                              (if (> sh sw) sh sw)))
                                     (cleared (recolor-cells out s-cells 0))
                                     (t-common-lr (- tc-mnr t-mnr))
                                     (t-common-lc (- tc-mnc t-mnc))
                                     (out-tl-r (- sc-mnr (* t-common-lr scale)))
                                     (out-tl-c (- sc-mnc (* t-common-lc scale))))
                                (reduce (lambda (o p)
                                          (let* ((tr (fst p))
                                                 (tc (snd p))
                                                 (v (cell-color p))
                                                 (new-v (if (= v t-other) new-color v))
                                                 (lr (- tr t-mnr))
                                                 (lc (- tc t-mnc)))
                                            (reduce (lambda (o2 dd)
                                                      (let* ((dr (fst dd))
                                                             (dc (snd dd))
                                                             (nr (+ out-tl-r
                                                                    (* lr scale)
                                                                    dr))
                                                             (nc (+ out-tl-c
                                                                    (* lc scale)
                                                                    dc)))
                                                        (if (in-bounds? nr nc h w)
                                                            (set-cell o2 nr nc new-v)
                                                            o2)))
                                                    o
                                                    (positions-in-rect 0
                                                                       0
                                                                       (- scale 1)
                                                                       (- scale 1)))))
                                        cleared
                                        t-cells)))))
           (reduce apply-seed g seeds))))

Provenance

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