← 9d2f7c9e2ac4 · 9d52c9d09009 →

9d488d6a3875

On every row and column, fill the inclusive span between exactly two same-color cells when the original span contains only zero and that color; row fills happen before column fills.

color matchingrow/column reasoningspan filling

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 (fill-row out r color)
      (let ((cols-hit (for/list ([c (in-range (cols g))] #:when (= (at g r c) color)) c)))
        (if (= (length cols-hit) 2)
            (let ((a (min (first cols-hit) (second cols-hit)))
                  (b (max (first cols-hit) (second cols-hit))))
              (if (all? (lambda (c) (member? (at g r c) (list 0 color))) (range a (+ b 1)))
                  (paint-cells out (for/list ([c (in-range a (+ b 1))]) (list r c)) color)
                  out))
            out)))
    (define (fill-col out c color)
      (let ((rows-hit (for/list ([r (in-range (rows g))] #:when (= (at g r c) color)) r)))
        (if (= (length rows-hit) 2)
            (let ((a (min (first rows-hit) (second rows-hit)))
                  (b (max (first rows-hit) (second rows-hit))))
              (if (all? (lambda (r) (member? (at g r c) (list 0 color))) (range a (+ b 1)))
                  (paint-cells out (for/list ([r (in-range a (+ b 1))]) (list r c)) color)
                  out))
            out)))
    (let ((row-filled
           (for/fold ([out g]) ([r (in-range (rows g))])
             (for/fold ([acc out]) ([color (in-list (remove-duplicates (filter (lambda (v) (not (= v 0))) (row g r))))])
               (fill-row acc r color)))))
      (for/fold ([out row-filled]) ([c (in-range (cols g))])
        (for/fold ([acc out]) ([color (in-list (remove-duplicates (filter (lambda (v) (not (= v 0))) (col g c))))])
          (fill-col acc c color))))))

Provenance

Generator
generators/9d488d6a3875/generator.py
Notes and decisions
generators/9d488d6a3875/notes.md
Review label
reviewed_safe
Generator SHA-256
2ab98b026a91b6585738b1adc64b1cf52e4d9fd3a9be712eebf8e8dcf7d2fbc1
Rule hash
f60c7e85088e
Sources
bank:be1bc1d91387
Lesson seeds
20261108, 20261109, 20261110, 20261111, 20261112
Reproduce lesson 1
arcpuzzles generate 9d488d6a3875 --count 1 --seed 20261108 --test 1