← 49fe4f572f8d · 4a279b104523 →

4a1526f51fb4

A zero-background grid contains two to four concentric rectangular outlines in one placeholder color above an ordered, distinct non-zero palette on the bottom row. The palette may carry one unused tail color after the entries needed by the frames. Successive outlines are inset by two cells on every side. Crop the outline bounding box, then recolor the outermost outline with the first palette color, the next outline with the second, and so on inward; the palette row is not copied to the output.

cropped outputnesting depthpalette strip

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 palette (filter (lambda (v) (not (= v 0))) (bottom-row g)))
    (define frame-cells
      (for*/list ([r (in-range (- (rows g) 1))]
                  [c (in-range (cols g))]
                  #:when (not (= (at g r c) 0)))
        (list r c)))
    (define bb (bbox-of-cells frame-cells))
    (define (border-filled? depth)
      (let ((r0 (+ (first bb) (* 2 depth)))
            (c0 (+ (second bb) (* 2 depth)))
            (r1 (- (third bb) (* 2 depth)))
            (c1 (- (fourth bb) (* 2 depth))))
        (and (<= r0 r1) (<= c0 c1)
             (all? (lambda (c) (and (not (= (at g r0 c) 0)) (not (= (at g r1 c) 0))))
                   (range c0 (+ c1 1)))
             (all? (lambda (r) (and (not (= (at g r c0) 0)) (not (= (at g r c1) 0))))
                   (range r0 (+ r1 1))))))
    (define depths
      (let loop ([d 0])
        (if (border-filled? d) (loop (+ d 1)) d)))
    (define out-h (+ 1 (- (third bb) (first bb))))
    (define out-w (+ 1 (- (fourth bb) (second bb))))
    (let loop ([out (empty-grid out-h out-w 0)] [d 0])
      (if (= d depths)
          out
          (let* ((r0 (+ (first bb) (* 2 d)))
                 (c0 (+ (second bb) (* 2 d)))
                 (r1 (- (third bb) (* 2 d)))
                 (c1 (- (fourth bb) (* 2 d)))
                 (color (nth palette d))
                 (cells (append
                          (for/list ([c (in-range c0 (+ c1 1))]) (list (- r0 (first bb)) (- c (second bb))))
                          (for/list ([c (in-range c0 (+ c1 1))]) (list (- r1 (first bb)) (- c (second bb))))
                          (for/list ([r (in-range r0 (+ r1 1))]) (list (- r (first bb)) (- c0 (second bb))))
                          (for/list ([r (in-range r0 (+ r1 1))]) (list (- r (first bb)) (- c1 (second bb)))))))
            (loop (paint-cells out cells color) (+ d 1)))))))

Provenance

Generator
generators/4a1526f51fb4/generator.py
Notes and decisions
generators/4a1526f51fb4/notes.md
Review label
reviewed_safe
Generator SHA-256
527f93937e7d90b269ef4e57ca5d8c692ad85232b6aaf4d9151b63989e1c853a
Rule hash
2e5956bb4999
Sources
bank:9a66c53abf7f
Lesson seeds
20261108, 20261109, 20261110, 20261111, 20261112
Reproduce lesson 1
arcpuzzles generate 4a1526f51fb4 --count 1 --seed 20261108 --test 1