← 2fb0197be694 · 2fc4ca4ea6c4 →

2fb8d019f6ca

Extract the four-connected non-{0,8} component rooted at (0,0), clear the canvas, and stamp its colored cells at every color-8 anchor. Samples mix canonical-size templates with longer templates, diagonal distractors and three/four anchors; source and stamped bounding boxes stay disjoint.

anchored stampingtemplate extraction

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).

Reference rule (Racket)

(rule!
  (let ((dummy 0))
    (define (crop-cells base cells)
      (let* ((bb (bbox-of-cells cells))
             (r0 (first bb)) (c0 (second bb))
             (r1 (third bb)) (c1 (fourth bb)))
        (grid-from-fn (+ 1 (- r1 r0)) (+ 1 (- c1 c0))
          (lambda (r c)
            (let ((rr (+ r0 r)) (cc (+ c0 c)))
              (if (member? (list rr cc) cells) (at base rr cc) 0))))))
    (define (paste-nonzero out pat top left)
      (for*/fold ([acc out])
                 ([r (in-range (rows pat))]
                  [c (in-range (cols pat))]
                  #:when (not (= (at pat r c) 0)))
        (let ((rr (+ top r)) (cc (+ left c)))
          (if (in-bounds? rr cc (rows acc) (cols acc))
              (set-cell acc rr cc (at pat r c))
              acc))))
    (let* ((template-cells
             (connected-region g 0 0
               (lambda (r c v) (and (not (= v 0)) (not (= v 8))))
               4))
           (template (crop-cells g template-cells))
           (anchors (find-color g 8)))
      (for/fold ([out (empty-grid (rows g) (cols g) 0)])
                ([anchor (in-list anchors)])
        (paste-nonzero out template (first anchor) (second anchor))))))

Provenance

Generator
generators/2fb8d019f6ca/generator.py
Notes and decisions
generators/2fb8d019f6ca/notes.md
Review label
reviewed_safe
Generator SHA-256
95bd2548bd79c429eb3c5f27584de455463528a41c7697da90cf28dab26f1ad0
Rule hash
b1a2d9fb3e21
Sources
bank:26462ff56908
Lesson seeds
20261108, 20261109, 20261110, 20261111, 20261112
Reproduce lesson 1
arcpuzzles generate 2fb8d019f6ca --count 1 --seed 20261108 --test 1