← 6d26bc40cbb2 · 6d678fbbe87e →

6d33e42a400d

Copy the connected source terrain across the paired marker/anchor lines, recoloring the copy with the sparse marker color.

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 colors (grid-colors g bg))
             (define source-color
               (argmax (lambda (c) (length (find-color g c))) colors))
             (define paint-color (find-first (lambda (c) (!= c source-color)) colors))
             (define paint-markers (find-color g paint-color))
             (define source-cells (find-color g source-color))
             (define same-row?
               (all? (lambda (p) (= (first p) (first (first paint-markers))))
                     paint-markers))
             (define (cell-sign x) (cond ((< x 0) -1) ((> x 0) 1) (else 0)))
             (define (same-list? a b) (equal? (sort a <) (sort b <)))
             (if same-row?
                 (let* ((marker-row (first (first paint-markers)))
                        (marker-cols (map second paint-markers))
                        (target-row (for/first ((r (range 0 h)) #:when
                                                 (and
                                                   (!= r marker-row)
                                                   (same-list? marker-cols
                                                               (map second
                                                                    (filter (lambda (p)
                                                                              (= (first p)
                                                                                 r))
                                                                            source-cells)))))
                                               r))
                        (dir (if (> target-row marker-row) -1 1)))
                   (foldl (lambda (p acc)
                            (let ((r (first p))
                                  (c (second p)))
                              (if (= (cell-sign (- r marker-row)) dir)
                                  (let ((nr (+ target-row (- marker-row r))))
                                    (if (and (>= nr 0) (< nr h))
                                        (set-cell acc nr c paint-color)
                                        acc))
                                  acc)))
                          g
                          source-cells))
                 (let* ((marker-col (second (first paint-markers)))
                        (marker-rows (map first paint-markers))
                        (target-col (for/first ((c (range 0 w)) #:when
                                                 (and
                                                   (!= c marker-col)
                                                   (same-list? marker-rows
                                                               (map first
                                                                    (filter (lambda (p)
                                                                              (= (second p)
                                                                                 c))
                                                                            source-cells)))))
                                               c))
                        (dir (if (> target-col marker-col) -1 1)))
                   (foldl (lambda (p acc)
                            (let ((r (first p))
                                  (c (second p)))
                              (if (= (cell-sign (- c marker-col)) dir)
                                  (let ((nc (+ target-col (- marker-col c))))
                                    (if (and (>= nc 0) (< nc w))
                                        (set-cell acc r nc paint-color)
                                        acc))
                                  acc)))
                          g
                          source-cells)))))))

Provenance

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