← 0b999a8ea028 · 0ba6a62312d0 →
0b9e771d6ba5
Restore foreground-only impure color bboxes, then repaint original non-background cells along complete horizontal, vertical, or diagonal color spans in ascending color order.
parametric family
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! (lambda (g) (let* ((h (rows g)) (w (cols g))) (let* ((bg (mode g -1)) (result (make-hash))) (for* ((r (range 0 h)) (c (range 0 w))) (hash-set! result (list r c) (at g r c))) (for ((color (range 1 10))) (when (!= color bg) (let ((cells (find-color g color))) (unless (empty? cells) (let* ((r0 (min-of fst cells)) (r1 (max-of fst cells)) (c0 (min-of snd cells)) (c1 (max-of snd cells)) (foreign #f) (has-bg #f)) (for* ((r (range r0 (+ r1 1))) (c (range c0 (+ c1 1)))) (let ((v (at g r c))) (when (= v bg) (set! has-bg #t)) (when (and (!= v bg) (!= v color)) (set! foreign #t)))) (when (and foreign (not has-bg)) (for* ((r (range r0 (+ r1 1))) (c (range c0 (+ c1 1)))) (hash-set! result (list r c) color)))))))) (for ((color (range 1 10))) (when (!= color bg) (let ((cells (find-color g color))) (when (> (length cells) 1) (let* ((rs (map fst cells)) (cs (map snd cells)) (same-row (= (min-list rs) (max-list rs))) (same-col (= (min-list cs) (max-list cs))) (diag-a (= (min-of (lambda (p) (- (fst p) (snd p))) cells) (max-of (lambda (p) (- (fst p) (snd p))) cells))) (diag-b (= (min-of (lambda (p) (+ (fst p) (snd p))) cells) (max-of (lambda (p) (+ (fst p) (snd p))) cells))) (dir (cond (same-row (list 0 1)) (same-col (list 1 0)) (diag-a (list 1 1)) (diag-b (list 1 -1)) (else #f)))) (when dir (let* ((ordered (sort-by cells (lambda (p) (+ (* 1000 (fst p)) (snd p))))) (start (fst ordered)) (end (nth ordered (- (length ordered) 1))) (dr (fst dir)) (dc (snd dir)) (steps (if same-row (abs (- (snd end) (snd start))) (abs (- (fst end) (fst start)))))) (for ((k (range 0 (+ steps 1)))) (let ((r (+ (fst start) (* k dr))) (c (+ (snd start) (* k dc)))) (when (and (in-bounds? r c h w) (!= (at g r c) bg)) (hash-set! result (list r c) color))))))))))) (cellmap g (r c v) (hash-ref result (list r c) bg))))))
Provenance
- Generator
- generators/0b9e771d6ba5/generator.py
- Notes and decisions
- generators/0b9e771d6ba5/notes.md
- Review label
- reviewed_safe
- Generator SHA-256
- 395687a3c029d39d3a61380f30b6b8a20f50f17efb4e1c877bd1c8442322e3f2
- Rule hash
- 654b94529e3a
- Sources
- augmented, training
- Lesson seeds
- 20261108, 20261109, 20261110, 20261111, 20261112
- Reproduce lesson 1
arcpuzzles generate 0b9e771d6ba5 --count 1 --seed 20261108 --test 1