← 1d26c382ab68 · 1d62131e83ca →

1d2c53122095

A zero-background grid contains two to five strictly nested yellow (4) rectangular frames and k red (2) markers in the top row. Count the red markers, select the k-th frame from outside to inside, and fill cyan (8) background inside that frame down to the next inner frame. If k selects the innermost frame, fill its central interior. Linked profiles vary canvas size, frame count, frame gap, aspect ratio, placement, and depth.

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!
  (let* ((frames
           (sort
             (filter
               (lambda (obj)
                 ;; Bounding box (r1 c1 r2 c2) of obj
                 (let* ((bb (obj-bbox obj))
                        ;; Top edge (row r1)
                        (r0 (first bb))
                        ;; Left edge (col c1)
                        (c0 (second bb))
                        ;; Bottom edge (row r2)
                        (r1 (third bb))
                        ;; Right edge (col c2)
                        (c1 (fourth bb))
                        ;; Bbox height (rows)
                        (height (+ (- r1 r0) 1))
                        ;; Bbox width (cols)
                        (width (+ (- c1 c0) 1))
                        (perimeter (- (+ (* 2 height) (* 2 width)) 4)))
                   (and (= (obj-color obj) 4)
                        (= (obj-size obj) perimeter)
                        (all?
                          (lambda (p)
                            (let ((pr (fst p)) (pc (snd p)))
                              (= (cell-at g pr pc) 4)))
                          (filter
                            (lambda (p)
                              (let ((pr (fst p)) (pc (snd p)))
                                (or (= pr r0) (= pr r1) (= pc c0) (= pc c1))))
                            (positions-in-rect r0 c0 r1 c1))))))
               (objects g 0))
             (lambda (a b)
               ;; Bounding box (r1 c1 r2 c2) of a
               (let* ((ba (obj-bbox a))
                      ;; Bounding box (r1 c1 r2 c2) of b
                      (bb (obj-bbox b))
                      (aa (* (+ (- (third ba) (first ba)) 1)
                             (+ (- (fourth ba) (second ba)) 1)))
                      (ab (* (+ (- (third bb) (first bb)) 1)
                             (+ (- (fourth bb) (second bb)) 1))))
                 (> aa ab)))))
         (raw-k (count-where (lambda (c) (= (cell-at g 0 c) 2)) (range w)))
         (k (max 1 (min raw-k (length frames))))
         (target (nth frames (- k 1)))
         (inner (if (< k (length frames)) (nth frames k) #f))
         ;; Bounding box (r1 c1 r2 c2) of target
         (tb (obj-bbox target))
         (ib (if inner (obj-bbox inner) (list -1 -1 -1 -1))))
    (grid-from-fn h w
      (lambda (r c)
        (let ((v (cell-at g r c)))
          (if (and (= v 0)
                   (> r (first tb)) (< r (third tb))
                   (> c (second tb)) (< c (fourth tb))
                   (not (and inner
                             (> r (first ib)) (< r (third ib))
                             (> c (second ib)) (< c (fourth ib)))))
              8
              v))))))

Provenance

Generator
generators/1d2c53122095/generator.py
Notes and decisions
generators/1d2c53122095/notes.md
Review label
reviewed_safe
Generator SHA-256
7bfef1bdd990a287df1b17bbb38061545f95be940601a5e4fb8fb5628317feb7
Rule hash
4e070bae635e
Sources
bank:e2825ca16ace
Lesson seeds
20261108, 20261109, 20261110, 20261111, 20261112
Reproduce lesson 1
arcpuzzles generate 1d2c53122095 --count 1 --seed 20261108 --test 1