← de49e9901e3a · dee38d045bc9 →

de6d50ef73a3

Tightly crop the global nonzero pattern, preserving all colors and internal zeros, then paste it at the top-left of an equal-size zero canvas.

parametric familycrop to bboxsame-size canvastranslation

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 (nonzero-cells grid) (filter (lambda (p) (not (= (at grid (first p) (second p)) 0))) (grid-positions grid))) (define (crop-nonzero grid) (let ((cells (nonzero-cells grid))) (if (empty? cells) (list (list 0)) (let* ((bb (bbox-of-cells cells))) (subgrid grid (first bb) (second bb) (third bb) (fourth bb)))))) (define (e8b-paste grid pat top left) (for*/fold ((out grid)) ((r (in-range (rows pat))) (c (in-range (cols pat)))) (let ((v (at pat r c)) (rr (+ top r)) (cc (+ left c))) (if (and (not (= v 0)) (in-bounds? rr cc (rows out) (cols out))) (set-cell out rr cc v) out)))) (e8b-paste (empty-grid (rows g) (cols g) 0) (crop-nonzero g) 0 0)))

Provenance

Generator
generators/de6d50ef73a3/generator.py
Notes and decisions
generators/de6d50ef73a3/notes.md
Review label
reviewed_safe
Generator SHA-256
cf63a0678ae9c289340cf3a838853e694ce567dfa90e03e3ee4c0bd05c703c67
Rule hash
6806b894d39b
Sources
bank:ad4abc25f505
Lesson seeds
20261108, 20261109, 20261110, 20261111, 20261112
Reproduce lesson 1
arcpuzzles generate de6d50ef73a3 --count 1 --seed 20261108 --test 1