← e282a664f807 · e2eab62ba331 →

e2bc70324918

Orange(7) field with ONE line (straight or diagonal, 2 endpoints) in line-color and 2-4 GLYPHS (all the same shape, including canonical X/I forms) in stamp-color, all separated. Rule: connect every pair of glyph centers with line-color lines, and stamp the glyph shape (stamp-color) centered at each of the line's two endpoints. Net: line endpoints <-> glyph stamps; glyph centers <-> a line network.

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)))
           (begin
             (define bg (mode g -1))
             (define objs (objects-8 g bg))
             (define (cell-in? cells r c) (member (list r c) cells))
             (define (neighbor-count cells p)
               (for/sum ((d all-8-deltas))
                 (if (cell-in? cells (+ (first p) (first d)) (+ (second p) (second d)))
                     1
                     0)))
             (define (line-endpoints obj)
               (let ((cells (obj-cells obj)))
                 (filter (lambda (p) (= (neighbor-count cells p) 1)) cells)))
             (define line-obj
               (find-first (lambda (obj)
                             (and
                               (> (obj-size obj) 1)
                               (= (length (line-endpoints obj)) 2)))
                           objs))
             (define line-color (obj-color line-obj))
             (define stamp-color
               (find-first (lambda (c) (!= c line-color)) (grid-colors g bg)))
             (define stamp-objs
               (filter (lambda (obj) (= (obj-color obj) stamp-color)) objs))
             (define stamp-cells (normalize-cells (obj-cells (first stamp-objs))))
             (define stamp-bb (bbox-of-cells stamp-cells))
             (define stamp-cr (quotient (+ (first stamp-bb) (third stamp-bb)) 2))
             (define stamp-cc (quotient (+ (second stamp-bb) (fourth stamp-bb)) 2))
             (define endpoints (line-endpoints line-obj))
             (define centers
               (map (lambda (obj)
                      (list (quotient (+ (obj-r1 obj) (obj-r2 obj)) 2)
                            (quotient (+ (obj-c1 obj) (obj-c2 obj)) 2)))
                    stamp-objs))
             (define network
               (for*/fold ((acc (empty-grid h w bg)))
                          ((i (range 0 (length centers))) (j (range (+ i 1) (length centers))))
                          (let ((a (list-ref centers i))
                                (b (list-ref centers j)))
                            (draw-line acc
                                       (first a)
                                       (second a)
                                       (first b)
                                       (second b)
                                       line-color))))
             (foldl (lambda (endpoint acc)
                      (foldl (lambda (p acc2)
                               (let ((nr (+ (first endpoint) (- (first p) stamp-cr)))
                                     (nc (+ (second endpoint) (- (second p) stamp-cc))))
                                 (if (and (>= nr 0) (< nr h) (>= nc 0) (< nc w))
                                     (set-cell acc2 nr nc stamp-color)
                                     acc2)))
                             acc
                             stamp-cells))
                    network
                    endpoints)))))

Provenance

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