← e5ead55c33e7 · e64c021e29ad →

e5ec1ac39df5

A one- to four-row by one- to four-column lattice of rectangular rooms is separated by color-1 walls, optionally with color-7 door cells. One or more rooms contain a color-2 seed, centered or off center. Paint on a blank grid the color-1/color-7 wall cells immediately adjacent to every seeded room.

parametric familyroom boundaries, wall extraction, boundary rendering

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 (wall? v) (member? v (list 1 7 9))) (define (make-room id cells) (let* ((bb (bbox-of-cells cells)) (r (first bb)) (c (second bb)) (h (+ 1 (- (third bb) r))) (w (+ 1 (- (fourth bb) c)))) (list id cells (list r c h w)))) (define (room-id room) (first room)) (define (room-cells room) (second room)) (define (extract-room-data grid) (define seen (make-hash)) (define cell-to-rid (make-hash)) (define rooms (list)) (for* ((r (in-range (rows grid))) (c (in-range (cols grid)))) (when (and (not (wall? (at grid r c))) (not (hash-has-key? seen (list r c)))) (define cells (connected-region grid r c (lambda (rr cc v) (not (wall? v))) 4)) (define id (length rooms)) (for ((p (in-list cells))) (hash-set! seen p #t) (hash-set! cell-to-rid p id)) (set! rooms (append rooms (list (make-room id cells)))))) (list rooms cell-to-rid)) (define (room-graph grid) (let* ((data (extract-room-data grid)) (rooms (first data)) (cell-to-rid (second data)) (adj (make-hash))) (for ((room (in-list rooms))) (hash-set! adj (room-id room) (list))) (define (add-edge a b) (hash-set! adj a (sort (remove-duplicates (cons b (hash-ref adj a (list)))) <)) (hash-set! adj b (sort (remove-duplicates (cons a (hash-ref adj b (list)))) <))) (for* ((r (in-range (rows grid))) (c (in-range (cols grid)))) (when (= (at grid r c) 7) (define ids (remove-duplicates (filter number? (map (lambda (d) (hash-ref cell-to-rid (list (+ r (first d)) (+ c (second d))) #f)) cardinal-deltas)))) (for* ((a (in-list ids)) (col (in-list ids))) (when (< a col) (add-edge a col))))) (list rooms adj cell-to-rid))) (define (room-has-color? grid room color) (not (eq? (find-first (lambda (p) (= (at grid (first p) (second p)) color)) (room-cells room)) #f))) (define (wall-boundary-cells room grid) (remove-duplicates (filter (lambda (p) (and (in-bounds? (first p) (second p) (rows grid) (cols grid)) (member? (at grid (first p) (second p)) (list 1 7)))) (flatmap (lambda (p) (map (lambda (d) (list (+ (first p) (first d)) (+ (second p) (second d)))) cardinal-deltas)) (room-cells room))))) (let* ((rg (room-graph g)) (rooms (first rg)) (cells (remove-duplicates (flatmap (lambda (room) (if (room-has-color? g room 2) (wall-boundary-cells room g) (list))) rooms)))) (paint-cells (empty-grid (rows g) (cols g) 0) cells 8))))

Provenance

Generator
generators/e5ec1ac39df5/generator.py
Notes and decisions
generators/e5ec1ac39df5/notes.md
Review label
reviewed_safe
Generator SHA-256
62304de2fa9b989ee1de657378a3d8764ee37dd8f73dfb0aec9edf1150ad9a8a
Rule hash
ee68f3c23aa1
Sources
bank:445ef4275a64
Lesson seeds
20261108, 20261109, 20261110, 20261111, 20261112
Reproduce lesson 1
arcpuzzles generate e5ec1ac39df5 --count 1 --seed 20261108 --test 1