← 7e19bce9c44c · 7e7614405852 →
7e52d15790d7
Three isolated, distinct-color components have true 4-neighbor edge perimeters 12, 10, and 8. Sort the components by that perimeter in descending order, crop each to its bounding box, and gallery-pack the crops left-to-right with one zero column between them. The scheduled shape families explicitly distinguish true perimeter from bbox perimeter, area, and input position.
parametric familycomponent perimetergallery packingranking
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 dirs4 (list (list -1 0) (list 1 0) (list 0 -1) (list 0 1))) (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 (e5b-nz-components grid) (let loop-pos ((positions (grid-positions grid)) (seen (list)) (acc (list))) (cond ((empty? positions) (reverse acc)) ((or (member? (first positions) seen) (= (at grid (first (first positions)) (second (first positions))) 0)) (loop-pos (rest positions) seen acc)) (else (let bfs ((queue (list (first positions))) (seen2 (cons (first positions) seen)) (cells (list))) (if (empty? queue) (loop-pos (rest positions) seen2 (cons (reverse cells) acc)) (let* ((cur (first queue)) (nbrs (filter (lambda (p) (and (in-bounds? (first p) (second p) (rows grid) (cols grid)) (not (member? p seen2)) (not (= (at grid (first p) (second p)) 0)))) (map (lambda (d) (list (+ (first cur) (first d)) (+ (second cur) (second d)))) dirs4)))) (bfs (append (rest queue) nbrs) (append seen2 nbrs) (cons cur cells))))))))) (define (f4-norm cells) (let* ((bb (bbox-of-cells cells)) (r0 (first bb)) (c0 (second bb))) (map (lambda (p) (list (- (first p) r0) (- (second p) c0))) cells))) (define (f4-norm-info cells) (let* ((bb (bbox-of-cells cells)) (r0 (first bb)) (c0 (second bb)) (r1 (third bb)) (c1 (fourth bb))) (list (f4-norm cells) (+ 1 (- r1 r0)) (+ 1 (- c1 c0))))) (define (f4-perimeter cells) (let ((norm (first (f4-norm-info cells)))) (apply + (map (lambda (p) (length (filter (lambda (d) (not (member? (list (+ (first p) (first d)) (+ (second p) (second d))) norm))) dirs4))) norm)))) (define (s17b-gallery-row objs (gap 1)) (if (empty? objs) (list (list 0)) (let* ((h (apply max (map rows objs))) (w (+ (apply + (map cols objs)) (* gap (- (length objs) 1))))) (let loop ((rest-objs objs) (left 0) (out (empty-grid h w 0))) (if (empty? rest-objs) out (let ((obj (first rest-objs))) (loop (rest rest-objs) (+ left (cols obj) gap) (e8b-paste out obj 0 left)))))))) (define (s6-component-grid grid cells) (let ((bb (bbox-of-cells cells))) (grid-from-fn (+ 1 (- (third bb) (first bb))) (+ 1 (- (fourth bb) (second bb))) (lambda (r c) (let ((rr (+ (first bb) r)) (cc (+ (second bb) c))) (if (member? (list rr cc) cells) (at grid rr cc) 0)))))) (define (s6b-component-crop grid cells) (s6-component-grid grid cells)) (let* ((items (sort (for/list ((comp (in-list (e5b-nz-components g)))) (let ((bb (bbox-of-cells comp))) (list (f4-perimeter comp) (first bb) (second bb) (s6b-component-crop g comp)))) (lambda (a b) (e8b-list< (list (- (first a)) (second a) (third a)) (list (- (first b)) (second b) (third b))))))) (s17b-gallery-row (map fourth items) 1))))
Provenance
- Generator
- generators/7e52d15790d7/generator.py
- Notes and decisions
- generators/7e52d15790d7/notes.md
- Review label
- reviewed_safe
- Generator SHA-256
- 22e37d18e32c5c0957fdeb8b6c67dba6172719292f8e4fd0969de7b03acaae09
- Rule hash
- 50de31dd583a
- Sources
- bank:529ce7614691
- Lesson seeds
- 20261108, 20261109, 20261110, 20261111, 20261112
- Reproduce lesson 1
arcpuzzles generate 7e52d15790d7 --count 1 --seed 20261108 --test 1