← 31e0316dace3 · 3233860e2d81 →

31e43af4bcfa

Row 0 is a left-aligned palette of K distinct colors. Rows 1+ contain K separate 4-connected color-1 objects. Sort the objects by (cell count ascending, top row ascending, left column ascending), recolor them with the palette in that order, crop each object to its bounding box, and pack the crops left-to-right with one zero column between adjacent pieces. Equal-size objects are intentional: top row, then left column, resolves ties. Five demonstrations preserve the scheduled area, connectivity, and tie witnesses under query rotation.

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 (component-grid obj) (let* ((bb (obj-bbox obj)) (h (+ 1 (- (third bb) (first bb)))) (w (+ 1 (- (fourth bb) (second bb))))) (for/fold ((out (empty-grid h w 0))) ((p (in-list (obj-cells obj)))) (set-cell out (- (first p) (first bb)) (- (second p) (second bb)) (obj-color obj))))) (define (paste-crop grid shape top left) (for*/fold ((out grid)) ((r (in-range (rows shape))) (c (in-range (cols shape)))) (let ((v (at shape 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 (pack-pieces pieces) (if (empty? pieces) (list (list 0)) (let* ((h (apply max (map rows pieces))) (w (+ (apply + (map cols pieces)) (max 0 (- (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) (paste-crop out (first xs) 0 left))))))) (define (recolor-grid grid color) (grid-from-fn (rows grid) (cols grid) (lambda (r c) (if (= (at grid r c) 0) 0 color)))) (let* ((palette (filter (lambda (v) (not (= v 0))) (first g))) (body (subgrid g 1 0 (- (rows g) 1) (- (cols g) 1))) (items (sort (map (lambda (obj) (let ((bb (obj-bbox obj))) (list (obj-size obj) (first bb) (second bb) (component-grid obj)))) (objects body 0)) (lambda (a b) (cond ((not (= (first a) (first b))) (< (first a) (first b))) ((not (= (second a) (second b))) (< (second a) (second b))) (else (< (third a) (third b))))))) (pieces (map (lambda (pair) (recolor-grid (fourth (first pair)) (second pair))) (map list items palette)))) (pack-pieces pieces))))

Provenance

Generator
generators/31e43af4bcfa/generator.py
Notes and decisions
generators/31e43af4bcfa/notes.md
Review label
reviewed_safe
Generator SHA-256
957ffcfc3550177532091e46ea8717bb63b583b9a7871a8360ec2f1e2f58d1d0
Rule hash
82a777a1969e
Sources
bank:7d2e04a04712
Lesson seeds
20261108, 20261109, 20261110, 20261111, 20261112
Reproduce lesson 1
arcpuzzles generate 31e43af4bcfa --count 1 --seed 20261108 --test 1