← 5a6a772cd217 · 5a85abd1e231 →

5a70e1b62a50

A canonical-scale zero-background grid contains one or two same-color wall objects. Closed walls enclose one or two zero regions; an optional open wall is a contrast object. Fill exactly the zero regions disconnected from the canvas border and surrounded by one color. Scheduled profiles include a canonical rectangle, an irregular enclosure, two separated same-color holes, and a closed/open contrast.

enclosurehole fillregion detection

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 ((seen (make-hash)) (out g))
    (for* ([r (in-range (rows g))] [c (in-range (cols g))])
      (when (and (= (at g r c) 0) (not (hash-has-key? seen (cons r c))))
        (define queue (list (cons r c)))
        (define region (list))
        (define border #f)
        (define neigh (list))
        (hash-set! seen (first queue) #t)
        (let bfs ([fuel 0])
          (unless (empty? queue)
            (let ((cur (first queue)))
              (set! queue (rest queue))
              (set! region (cons (list (car cur) (cdr cur)) region))
              (when (or (= (car cur) 0) (= (cdr cur) 0) (= (car cur) (- (rows g) 1)) (= (cdr cur) (- (cols g) 1)))
                (set! border #t))
              (for ([d (in-list cardinal-deltas)])
                (let ((nr (+ (car cur) (first d))) (nc (+ (cdr cur) (second d))))
                  (when (in-bounds? nr nc (rows g) (cols g))
                    (cond [(and (= (at g nr nc) 0) (not (hash-has-key? seen (cons nr nc))))
                           (hash-set! seen (cons nr nc) #t)
                           (set! queue (append queue (list (cons nr nc))))]
                          [(not (= (at g nr nc) 0))
                           (set! neigh (cons (at g nr nc) neigh))])))))
            (bfs (+ fuel 1))))
        (let ((colors (remove-duplicates neigh)))
          (when (and (not border) (= (length colors) 1))
            (set! out (paint-cells out region (first colors)))))))
    out))

Provenance

Generator
generators/5a70e1b62a50/generator.py
Notes and decisions
generators/5a70e1b62a50/notes.md
Review label
reviewed_safe
Generator SHA-256
24cb3ea5fe87b5e6e35116d353e6733940913bf3d31c95e85e07c7fe58e3dddb
Rule hash
92650211204a
Sources
bank:0f1ff2289d6f
Lesson seeds
20261108, 20261109, 20261110, 20261111, 20261112
Reproduce lesson 1
arcpuzzles generate 5a70e1b62a50 --count 1 --seed 20261108 --test 1