← c425a7cc61c7 · c4d63d8b4567 →

c464f6b94fbb

Sort nonzero component crops by (-size, top, left), then stack their raw bounding boxes left-to-right with one zero-column gap.

component extractionlayout synthesissorting

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).

Reference rule (Racket)

(rule!
  (let ((dummy 0))
    (define sorted-objs
      (sort (objects g 0)
        (lambda (a b)
          (cond [(not (= (obj-size a) (obj-size b))) (> (obj-size a) (obj-size b))]
                [(not (= (obj-r1 a) (obj-r1 b))) (< (obj-r1 a) (obj-r1 b))]
                [else (< (obj-c1 a) (obj-c1 b))]))))
    (define crops (map (lambda (o) (subgrid g (obj-r1 o) (obj-c1 o) (obj-r2 o) (obj-c2 o))) sorted-objs))
    (define out-h (apply max (map rows crops)))
    (define out-w (+ (apply + (map cols crops)) (max 0 (- (length crops) 1))))
    (let loop ([out (empty-grid out-h out-w 0)] [remaining crops] [left 0])
      (if (empty? remaining)
          out
          (let ((crop (first remaining)))
            (loop (for*/fold ([acc out])
                              ([r (in-range (rows crop))]
                               [c (in-range (cols crop))])
                    (set-cell acc r (+ left c) (at crop r c)))
                  (rest remaining)
                  (+ left (cols crop) 1)))))))

Provenance

Generator
generators/c464f6b94fbb/generator.py
Notes and decisions
generators/c464f6b94fbb/notes.md
Review label
reviewed_safe
Generator SHA-256
1620523f02342f8593b4eb76e557d14c7fb6f7cfd8775be19e09d6f88e9a38fb
Rule hash
48e84ae04028
Sources
bank:e06827914c5c
Lesson seeds
20261108, 20261109, 20261110, 20261111, 20261112
Reproduce lesson 1
arcpuzzles generate c464f6b94fbb --count 1 --seed 20261108 --test 1