← 6b5d8752c5c4 · 6b6e3acc8a0a →
6b694a414d96
A closed 2-D lattice of rectangular rooms is separated by color-1/9 walls. Color-7 doors define room-graph edges and one room contains a color-2 seed. Preserve the walls, clear all rooms, and fill exactly the rooms one door away from the seed with color 8.
room graph, neighbor expansion, multi-target highlight
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 (walls-grid grid) (grid-from-fn (rows grid) (cols grid) (lambda (r c) (if (wall? (at grid r c)) (at grid r c) 0)))) (define (paint-room out room color) (paint-cells out (room-cells room) color)) (define (room-has-color? grid room color) (not (eq? (find-first (lambda (p) (= (at grid (first p) (second p)) color)) (room-cells room)) #f))) (let* ((rg (room-graph g)) (rooms (first rg)) (adj (second rg)) (seed (room-id (first (filter (lambda (room) (room-has-color? g room 2)) rooms))))) (for/fold ((out (walls-grid g))) ((rid (in-list (hash-ref adj seed)))) (paint-room out (list-ref rooms rid) 8)))))
Provenance
- Generator
- generators/6b694a414d96/generator.py
- Notes and decisions
- generators/6b694a414d96/notes.md
- Review label
- reviewed_safe
- Generator SHA-256
- d62e12de8d52bf223823a1b64fc7c798588cd5f5f4db5e6e0c2fe4aee5ab9708
- Rule hash
- bf24da6609f2
- Sources
- bank:445ef4275a64
- Lesson seeds
- 20261108, 20261109, 20261110, 20261111, 20261112
- Reproduce lesson 1
arcpuzzles generate 6b694a414d96 --count 1 --seed 20261108 --test 1