← 72b99d3a9be8 · 72dbce4d594b →

72c77addd109

A 0-background grid contains exactly two hollow rectangular frames and two other connected monochrome objects, all in distinct colors. Sort frames by interior area and objects by cell count; pair equal ranks. Return a fresh 0 grid with every frame redrawn at its original location and each paired object's tight crop centered on that frame. Nonzero crop cells are pasted after the frame, so a crop larger than the interior can overwrite frame-border cells. Original object locations disappear.

assignmentframesranking

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 ((dummy 0)) (define (object-grid grid obj) (subgrid grid (obj-r1 obj) (obj-c1 obj) (obj-r2 obj) (obj-c2 obj))) (define (bbox-border-cells r0 c0 r1 c1) (remove-duplicates (append (for/list ((c (in-range c0 (+ c1 1)))) (list r0 c)) (for/list ((c (in-range c0 (+ c1 1)))) (list r1 c)) (for/list ((r (in-range r0 (+ r1 1)))) (list r c0)) (for/list ((r (in-range r0 (+ r1 1)))) (list r c1))))) (define (frame-object? obj) (let ((border (bbox-border-cells (obj-r1 obj) (obj-c1 obj) (obj-r2 obj) (obj-c2 obj)))) (and (>= (obj-h obj) 3) (>= (obj-w obj) 3) (= (length border) (length (obj-cells obj))) (all? (lambda (p) (member p border)) (obj-cells obj))))) (define (frames grid) (filter frame-object? (objects grid 0))) (define (nonframes grid) (filter (lambda (obj) (not (frame-object? obj))) (objects grid 0))) (define (draw-frame out obj) (paint-cells out (obj-cells obj) (obj-color obj))) (define (floor-half n) (if (>= n 0) (quotient n 2) (- (quotient (+ (- n) 1) 2)))) (define (center-paste out crop fr) (let* ((ih (- (obj-r2 fr) (obj-r1 fr) 1)) (iw (- (obj-c2 fr) (obj-c1 fr) 1)) (top (+ (obj-r1 fr) 1 (floor-half (- ih (rows crop))))) (left (+ (obj-c1 fr) 1 (floor-half (- iw (cols crop)))))) (for*/fold ((acc out)) ((r (in-range (rows crop))) (c (in-range (cols crop)))) (let ((v (at crop r c))) (if (= v 0) acc (set-cell acc (+ top r) (+ left c) v)))))) (define frs (sort (frames g) (lambda (a b) (< (* (- (obj-r2 a) (obj-r1 a) 1) (- (obj-c2 a) (obj-c1 a) 1)) (* (- (obj-r2 b) (obj-r1 b) 1) (- (obj-c2 b) (obj-c1 b) 1)))))) (define solids (sort (nonframes g) (lambda (a b) (< (obj-size a) (obj-size b))))) (define out0 (for/fold ((out (empty-grid (rows g) (cols g) 0))) ((fr (in-list frs))) (draw-frame out fr))) (for/fold ((out out0)) ((obj (in-list solids)) (fr (in-list frs))) (center-paste out (object-grid g obj) fr))))

Provenance

Generator
generators/72c77addd109/generator.py
Notes and decisions
generators/72c77addd109/notes.md
Review label
reviewed_safe
Generator SHA-256
2d77cdf1ca4a1374f1022c3acc7b2171f22a1736d4d6d2c2ffcb5ea102df0c86
Rule hash
a657cfe83f60
Sources
bank:5dfff1627b31
Lesson seeds
20261108, 20261109, 20261110, 20261111, 20261112
Reproduce lesson 1
arcpuzzles generate 72c77addd109 --count 1 --seed 20261108 --test 1