← 675dcb932594 · 678b4a951150 →

677dcb71e2be

A 10..18 by 10..18 zero-background grid contains three or four diagonally separated monochrome components with distinct colors and distinct occupied-cell counts. Sort components by occupied-cell count descending and emit one row of same-color bars with those lengths, separated by one zero.

parametric familycomponent sizingdynamic output sizesorting

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!
  ;; Sort nonzero components by occupied-cell count, largest first.  The color
  ;; tie-break is deterministic but unreachable in the generator curriculum.
  (let* ((objs (sort (objects g 0)
                     (lambda (a b)
                       (cond [(not (= (obj-size a) (obj-size b))) (> (obj-size a) (obj-size b))]
                             [else (< (obj-color a) (obj-color b))]))))
         (total (+ (apply + (map obj-size objs)) (max 0 (- (length objs) 1)))))
    ;; Pack one same-color bar per component, separated by a single zero cell.
    (let pack ([remaining objs] [left 0] [out (empty-grid 1 total 0)])
      (if (empty? remaining)
          out
          (let* ((obj (first remaining))
                 (next (for/fold ([acc out]) ([c (in-range left (+ left (obj-size obj)))])
                         (set-cell acc 0 c (obj-color obj)))))
            (pack (rest remaining) (+ left (obj-size obj) 1) next))))))

Provenance

Generator
generators/677dcb71e2be/generator.py
Notes and decisions
generators/677dcb71e2be/notes.md
Review label
reviewed_safe
Generator SHA-256
156a890625a3569a167f9a28daf0df5dfef81900ff6c97971ead916c61c46975
Rule hash
a1028386df20
Sources
bank:f234ef852d75
Lesson seeds
20261111
Reproduce lesson 1
arcpuzzles generate 677dcb71e2be --count 1 --seed 20261111 --test 1