← 7b0cb3b9a618 · 7b6758552009 →

7b3c2eaee231

Three separated monochrome objects on background 0. Crop each object, sort by (bbox width, bbox height, color), and horizontally center-pack the crops with one-column gaps.

parametric familycomponent croppinghorizontal packingordering by width

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 (e8b-list< a b) (cond ((empty? a) #f) ((< (first a) (first b)) #t) ((> (first a) (first b)) #f) (else (e8b-list< (rest a) (rest b))))) (define (e8b-paste grid pat top left) (for*/fold ((out grid)) ((r (in-range (rows pat))) (c (in-range (cols pat)))) (let ((v (at pat r c)) (rr (+ top r)) (cc (+ left c))) (if (and (not (= v 0)) (in-bounds? rr cc (rows out) (cols out))) (set-cell out rr cc v) out)))) (define (f14-crop-cells grid cells) (let ((bb (bbox-of-cells cells))) (subgrid grid (first bb) (second bb) (third bb) (fourth bb)))) (define (f14b-hstack-center grids (gap 1)) (if (empty? grids) (list (list)) (let* ((h (apply max (map rows grids))) (w (+ (apply + (map cols grids)) (* gap (- (length grids) 1))))) (let loop ((xs grids) (left 0) (out (empty-grid h w 0))) (if (empty? xs) out (let* ((piece (first xs)) (top (quotient (- h (rows piece)) 2))) (loop (rest xs) (+ left (cols piece) gap) (e8b-paste out piece top left)))))))) (define (f14b-min-nonzero grid) (apply min (filter (lambda (v) (not (= v 0))) (apply append grid)))) (let* ((crops (map (lambda (obj) (f14-crop-cells g (obj-cells obj))) (objects g 0))) (sorted (sort crops (lambda (a b) (e8b-list< (list (cols a) (rows a) (f14b-min-nonzero a)) (list (cols b) (rows b) (f14b-min-nonzero b))))))) (f14b-hstack-center sorted 1))))

Provenance

Generator
generators/7b3c2eaee231/generator.py
Notes and decisions
generators/7b3c2eaee231/notes.md
Review label
reviewed_safe
Generator SHA-256
507dc207ce7a67ff1d4df24a4b4eb36fcc4ca8f3127c04e5e78bb30ff19ea8a9
Rule hash
afe9721b6609
Sources
bank:d82cc3a28c3b
Lesson seeds
20261108, 20261109, 20261110, 20261111, 20261112
Reproduce lesson 1
arcpuzzles generate 7b3c2eaee231 --count 1 --seed 20261108 --test 1