← 77e3acd21c5d · 7842d7d91514 →

78143e5d7ed1

Place three or four isolated, single-color polyominoes on a zero background. Extract each tight bbox crop and sort the components by (cell count, bbox height, bbox width, color) ascending. Pack the crops left-to-right with one zero column between them and bottom-align every crop to the tallest one. Each profile demonstrates two sort keys, so every four-of-five query rotation covers area, height, width, and color.

parametric familyareaobjectsorderingpacking

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 (crop-obj obj)
      (subgrid g (obj-r1 obj) (obj-c1 obj) (obj-r2 obj) (obj-c2 obj)))
    (define (min-nonzero crop)
      (apply min (filter (lambda (v) (not (= v 0))) (apply append crop))))
    (define items
      (sort (map (lambda (obj)
                   (let ((crop (crop-obj obj)))
                     (list (obj-size obj) (rows crop) (cols crop) (min-nonzero crop) crop)))
                 (objects g 0))
            (lambda (a b)
              (cond [(not (= (first a) (first b))) (< (first a) (first b))]
                    [(not (= (second a) (second b))) (< (second a) (second b))]
                    [(not (= (third a) (third b))) (< (third a) (third b))]
                    [else (< (fourth a) (fourth b))]))))
    (define crops (map fifth items))
    (define out-h (apply max (map rows crops)))
    (define out-w (+ (apply + (map cols crops)) (max 0 (- (length crops) 1))))
    (let pack ([remaining crops] [c0 0] [out (empty-grid out-h out-w 0)])
      (if (empty? remaining)
          out
          (let* ((crop (first remaining))
                 (r0 (- out-h (rows crop)))
                 (next (for*/fold ([acc out])
                                   ([r (in-range (rows crop))]
                                    [c (in-range (cols crop))])
                         (let ((v (at crop r c)))
                           (if (= v 0) acc (set-cell acc (+ r0 r) (+ c0 c) v))))))
            (pack (rest remaining) (+ c0 (cols crop) 1) next))))))

Provenance

Generator
generators/78143e5d7ed1/generator.py
Notes and decisions
generators/78143e5d7ed1/notes.md
Review label
reviewed_safe
Generator SHA-256
79d9f9c3243d6e353277e0a9ef0b722592269648e151658af56853787712813e
Rule hash
d87cff5947e7
Sources
bank:d7b013a675b4
Lesson seeds
20261108, 20261109, 20261110, 20261111, 20261112
Reproduce lesson 1
arcpuzzles generate 78143e5d7ed1 --count 1 --seed 20261108 --test 1