← c464f6b94fbb · c4f6a0585dbf →

c4d63d8b4567

On the original zero-background grid, scan each row and column independently. When a color occurs exactly twice on that line and every strictly interior cell is zero, fill the inclusive span with that color. Leave blocked and off-axis pairs unchanged.

axis alignmentpair matchingsegment 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).

Reference rule (Racket)

(rule!
  (let ((dummy 0))
    (define row-filled
      (for/fold ([out g]) ([r (in-range (rows g))])
        (for/fold ([acc out]) ([color (in-list (grid-colors g 0))])
          (let ((cols (map second
                           (filter (lambda (cell) (= (third cell) color))
                                   (for/list ([c (in-range (cols g))]) (list r c (at g r c)))))))
            (if (and (= (length cols) 2)
                     (all? (lambda (c) (= (at g r c) 0))
                           (range (+ (apply min cols) 1) (apply max cols))))
                (paint-cells acc
                  (for/list ([c (in-range (apply min cols) (+ (apply max cols) 1))]) (list r c))
                  color)
                acc)))))
    (for/fold ([out row-filled]) ([c (in-range (cols g))])
      (for/fold ([acc out]) ([color (in-list (grid-colors g 0))])
        (let ((rs (map first
                       (filter (lambda (cell) (= (third cell) color))
                               (for/list ([r (in-range (rows g))]) (list r c (at g r c)))))))
          (if (and (= (length rs) 2)
                   (all? (lambda (r) (= (at g r c) 0))
                         (range (+ (apply min rs) 1) (apply max rs))))
              (paint-cells acc
                (for/list ([r (in-range (apply min rs) (+ (apply max rs) 1))]) (list r c))
                color)
              acc))))))

Provenance

Generator
generators/c4d63d8b4567/generator.py
Notes and decisions
generators/c4d63d8b4567/notes.md
Review label
reviewed_safe
Generator SHA-256
87a0aa06a16dc6fde1d432f0229154986038ef61c534f13ef18bf38c9c09d0f1
Rule hash
3c80c97f70dc
Sources
bank:63dac95f0c67
Lesson seeds
20261108, 20261109, 20261110, 20261111, 20261112
Reproduce lesson 1
arcpuzzles generate c4d63d8b4567 --count 1 --seed 20261108 --test 1