← d2b3402dde86 · d2f386d0e071 →
d2d40680cd25
Two to four rigid colored pieces fall straight down around one fixed vertical color-8 wall; canonical-scale anchors occur in every difficulty band, and ordinary draws include wall support plus floor or piece-on-piece support.
gravityobstacle reasoningrigid-body motion
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 (clear-cells grid cells) (for/fold ((out grid)) ((p (in-list cells))) (set-cell out (first p) (second p) 0))) (define (blockers-except grid cells) (filter (lambda (p) (and (not (= (at grid (first p) (second p)) 0)) (not (member? p cells)))) (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 (motion-order comps dr dc) (cond ((= dr 1) (sort comps (lambda (a b) (> (obj-r2 a) (obj-r2 b))))) ((= dr -1) (sort comps (lambda (a b) (< (obj-r1 a) (obj-r1 b))))) ((= dc 1) (sort comps (lambda (a b) (> (obj-c2 a) (obj-c2 b))))) (else (sort comps (lambda (a b) (< (obj-c1 a) (obj-c1 b))))))) (define (gravity-slide-all grid dr dc immobile-colors remove-cells dynamic-colors) (define start (clear-cells grid remove-cells)) (let loop ((out start) (fuel (* 3 (rows grid) (cols grid)))) (if (<= fuel 0) out (let* ((movable (filter (lambda (obj) (and (not (member? (obj-color obj) immobile-colors)) (or (eq? dynamic-colors #f) (member? (obj-color obj) dynamic-colors)))) (objects out 0))) (ordered (motion-order movable dr dc)) (step-result (for/fold ((state (list out #f))) ((obj (in-list ordered))) (let* ((cur (first state)) (changed? (second state)) (cells (obj-cells obj)) (blockers (blockers-except cur cells)) (slid (slide-cells cur cells dr dc blockers))) (if (equal? slid cells) (list cur changed?) (list (paint-cells (clear-cells cur cells) slid (obj-color obj)) #t)))))) (if (second step-result) (loop (first step-result) (- fuel 1)) (first step-result)))))) (gravity-slide-all g 1 0 (list 8) (list) #f)))
Provenance
- Generator
- generators/d2d40680cd25/generator.py
- Notes and decisions
- generators/d2d40680cd25/notes.md
- Review label
- reviewed_safe
- Generator SHA-256
- 4c0151e11fbbe18a423daae4feb00fd1e88cf368789535da3f6b1e8737d906df
- Rule hash
- 09ddc1726a80
- Sources
- bank:6bdef6f37fa3
- Lesson seeds
- 20261108, 20261109, 20261110, 20261111, 20261112
- Reproduce lesson 1
arcpuzzles generate d2d40680cd25 --count 1 --seed 20261108 --test 1