← 20b5e7246250 · 21eb0f467b5a →

21d822423cfc

Flood zero cells in each non-5 chamber only when the chamber contains exactly one distinct seed color from 1, 2, or 3.

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 ((seen (make-hash))
        (out g))
    (for* ([r (in-range (rows g))] [c (in-range (cols g))])
      (unless (or (hash-has-key? seen (cons r c)) (= (at g r c) 5))
        (define queue (list (cons r c)))
        (define chamber (list))
        (hash-set! seen (first queue) #t)
        (let bfs ([step 0])
          (unless (empty? queue)
            (let ((cur (first queue)))
              (set! queue (rest queue))
              (set! chamber (cons (list (car cur) (cdr cur)) chamber))
              (for ([d (in-list cardinal-deltas)])
                (let ((nr (+ (car cur) (first d)))
                      (nc (+ (cdr cur) (second d))))
                  (when (and (in-bounds? nr nc (rows g) (cols g))
                             (not (hash-has-key? seen (cons nr nc)))
                             (not (= (at g nr nc) 5)))
                    (hash-set! seen (cons nr nc) #t)
                    (set! queue (append queue (list (cons nr nc))))))))
            (bfs (+ step 1))))
        (let ((seed-colors (remove-duplicates
                            (filter (lambda (v) (and (>= v 1) (<= v 3)))
                                    (map (lambda (p) (at g (first p) (second p))) chamber)))))
          (when (= (length seed-colors) 1)
            (for ([p (in-list chamber)])
              (when (= (at out (first p) (second p)) 0)
                (set! out (set-cell out (first p) (second p) (first seed-colors)))))))))
    out))

Provenance

Generator
generators/21d822423cfc/generator.py
Notes and decisions
generators/21d822423cfc/notes.md
Review label
reviewed_safe
Generator SHA-256
7fc3fefaac4b90e808db17e3b31e5078796a2cd2d9ed00506d2bd3bba7dde595
Rule hash
70caebbaa31c
Sources
bank:385e738e9e70
Lesson seeds
20261108, 20261109, 20261110, 20261111, 20261112
Reproduce lesson 1
arcpuzzles generate 21d822423cfc --count 1 --seed 20261108 --test 1