← d9d4f0ebb48b · dadeacb21d08 →
da16b5bf7632
Crop every same-color 4-connected component, sort the crops by enclosed hole count descending with reading-order ties, and top-align them with one blank column between adjacent crops.
parametric familyhole countingpackingtopology
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)))))) (define (e8b-hole-count grid) (length (filter (lambda (region) (not (any? (lambda (p) (or (= (first p) 0) (= (first p) (- (rows grid) 1)) (= (second p) 0) (= (second p) (- (cols grid) 1)))) region))) (find-0-regions grid 0)))) (let* ((items (sort (map (lambda (obj) (let ((piece (e8b-crop-obj g obj)) (bb (obj-bbox obj))) (list (- (e8b-hole-count piece)) (first bb) (second bb) piece))) (objects g 0)) (lambda (a b) (e8b-list< (list (first a) (second a) (third a)) (list (first b) (second b) (third b))))))) (e8b-hconcat (map fourth items)))))
Provenance
- Generator
- generators/da16b5bf7632/generator.py
- Notes and decisions
- generators/da16b5bf7632/notes.md
- Review label
- reviewed_safe
- Generator SHA-256
- 7d26a4654f01cb85c8a6fc64edf1baad2abd80106bfa40e501218e039541e3c1
- Rule hash
- 14cb9ccb4d29
- Sources
- bank:9397d19eada0
- Lesson seeds
- 20261108, 20261109, 20261110, 20261111, 20261112
- Reproduce lesson 1
arcpuzzles generate da16b5bf7632 --count 1 --seed 20261108 --test 1