← dc657616ec21 · dcb4d769d19d →

dc91f4798e24

Count the four-connected components of colors 1, 2, 3, not their areas. Random connected shapes, diagonal contacts, border contacts and optional colors 4..9 break pixel-count, eight-connected and color-blind shortcuts. Output is a three-row left-aligned histogram of width max(1, counts).

parametric family

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 (count-components color)
      (length (filter (lambda (o) (= (obj-color o) color)) (objects g 0))))
    (let* ((n1 (count-components 1))
           (n2 (count-components 2))
           (n3 (count-components 3))
           (ww (max 1 n1 n2 n3)))
      (grid-from-fn 3 ww
        (lambda (r c)
          (let ((cnt (cond [(= r 0) n1] [(= r 1) n2] [else n3]))
                (color (+ r 1)))
            (if (< c cnt) color 0)))))))

Provenance

Generator
generators/dc91f4798e24/generator.py
Notes and decisions
generators/dc91f4798e24/notes.md
Review label
reviewed_safe
Generator SHA-256
2dadb7679e19dc75fe6c86017bafc4502f292ddd2ae6931c50f0618346b4fbcd
Rule hash
1493886adfda
Sources
bank:343f662c728a
Lesson seeds
20261110
Reproduce lesson 1
arcpuzzles generate dc91f4798e24 --count 1 --seed 20261110 --test 1