← ea8116b3e778 · ead22faa41ef →

ea957ff0d072

A black grid contains one full-height color-8 wall and 2-3 distinct colored polyominoes, each touching one direction marker: 1=left, 2=right, 3=up, 4=down. Remove every marker, then process their original positions in row-major order. At each marker, slide the currently adjacent same-color component repeatedly in the marker direction until blocked by the current grid, so an earlier move can block a later one.

instruction decodingorder sensitivitystateful simulation

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 dirs4 (list (list -1 0) (list 1 0) (list 0 -1) (list 0 1))) (define (clear-cells grid cells) (for/fold ((out grid)) ((p (in-list cells))) (set-cell out (first p) (second p) 0))) (define (nonzero-cells grid) (filter (lambda (p) (not (= (at grid (first p) (second p)) 0))) (grid-positions grid))) (define (slide-cells grid cells dr dc blockers) (let loop ((cur cells)) (let ((nxt (translate-cells cur dr dc))) (if (and (all? (lambda (p) (in-bounds? (first p) (second p) (rows grid) (cols grid))) nxt) (not (any? (lambda (p) (member? p blockers)) nxt))) (loop nxt) cur)))) (define (direction-step marker) (cond ((= marker 1) (list 0 -1)) ((= marker 2) (list 0 1)) ((= marker 3) (list -1 0)) ((= marker 4) (list 1 0)) (else (list 0 0)))) (define (component-from-cell grid start) (let* ((color (at grid (first start) (second start)))) (let bfs ((queue (list start)) (seen (list start)) (cells (list))) (if (empty? queue) (list 'color color 'cells (sort cells cell<)) (let* ((cur (first queue)) (restq (rest queue)) (nbrs (filter (lambda (p) (and (in-bounds? (first p) (second p) (rows grid) (cols grid)) (not (member? p seen)) (= (at grid (first p) (second p)) color))) (map (lambda (d) (list (+ (first cur) (first d)) (+ (second cur) (second d)))) dirs4)))) (bfs (append restq nbrs) (append seen nbrs) (cons cur cells))))))) (define (comp-hash-color comp) (second comp)) (define (comp-hash-cells comp) (fourth comp)) (let* ((markers (sort (filter values (for*/list ((r (in-range (rows g))) (c (in-range (cols g)))) (let ((v (at g r c))) (if (member? v (list 1 2 3 4)) (list r c v) #f)))) (lambda (a b) (cell< a b)))) (marker-cells (map (lambda (m) (list (first m) (second m))) markers)) (start (clear-cells g marker-cells))) (for/fold ((out start)) ((m (in-list markers))) (let* ((mr (first m)) (mc (second m)) (mv (third m)) (step (direction-step mv)) (adjs (sort (filter (lambda (p) (and (in-bounds? (first p) (second p) (rows out) (cols out)) (not (member? (at out (first p) (second p)) (list 0 8))))) (map (lambda (d) (list (+ mr (first d)) (+ mc (second d)))) dirs4)) cell<))) (if (empty? adjs) out (let* ((comp (component-from-cell out (first adjs))) (color (comp-hash-color comp)) (cells (comp-hash-cells comp)) (cleared (clear-cells out cells)) (slid (slide-cells cleared cells (first step) (second step) (nonzero-cells cleared)))) (paint-cells cleared slid color))))))))

Provenance

Generator
generators/ea957ff0d072/generator.py
Notes and decisions
generators/ea957ff0d072/notes.md
Review label
reviewed_safe
Generator SHA-256
29956569638659c4561a7c9b06eec798d842609a3f51de202780ee40d25de2cb
Rule hash
d849dec31c02
Sources
bank:6bdef6f37fa3
Lesson seeds
20261108, 20261109, 20261110, 20261111, 20261112
Reproduce lesson 1
arcpuzzles generate ea957ff0d072 --count 1 --seed 20261108 --test 1