← 956425dc719c · 959992fc8fa9 →

95705262dbee

Three isolated distinct-color components with canonical distinct-size profiles. Sort their cropped shapes by increasing cell count and pack them top-aligned from left to right with one zero column between shapes.

area sortingcomponent extractionpacking

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-crop-obj grid obj) (let ((bb (obj-bbox obj))) (subgrid grid (first bb) (second bb) (third bb) (fourth bb)))) (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 (e8b-hconcat pieces) (let* ((h (apply max (map rows pieces))) (w (+ (apply + (map cols pieces)) (- (length pieces) 1)))) (let loop ((xs pieces) (left 0) (out (empty-grid h w 0))) (if (empty? xs) out (loop (rest xs) (+ left (cols (first xs)) 1) (e8b-paste out (first xs) 0 left)))))) (let* ((objs (sort (objects g 0) (lambda (a b) (let ((ba (obj-bbox a)) (bb (obj-bbox b))) (e8b-list< (list (obj-size a) (first ba) (second ba)) (list (obj-size b) (first bb) (second bb))))))) (pieces (map (lambda (obj) (e8b-crop-obj g obj)) objs))) (e8b-hconcat pieces))))

Provenance

Generator
generators/95705262dbee/generator.py
Notes and decisions
generators/95705262dbee/notes.md
Review label
reviewed_safe
Generator SHA-256
f15b6fe8b10e5f03e76df4847aa470a29885c27fa43e5d18543f4b6e716e0c57
Rule hash
7d39da4c591e
Sources
bank:9397d19eada0
Lesson seeds
20261108, 20261109, 20261110, 20261111, 20261112
Reproduce lesson 1
arcpuzzles generate 95705262dbee --count 1 --seed 20261108 --test 1