← 8c069ab108a1 · 8c5406fbf66c →

8c12816521a2

Recolor yellow tips green and extend yellow/cyan/red bands across a full separator in triggered lanes.

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* ((h-sep-rows (filter (lambda (r)
                                        (all? (lambda (c) (= (at g r c) 8)) (range 0 w)))
                                      (range 0 h)))
                  (h-sep (and (> (length h-sep-rows) 0) (first h-sep-rows)))
                  (is-horiz (and h-sep #t))
                  (ng (if is-horiz (transpose g) g))
                  (nh (rows ng))
                  (nw (cols ng))
                  (sep (find-first (lambda (c)
                                     (all? (lambda (r) (= (at ng r c) 8)) (range 0 nh)))
                                   (range 0 nw)))
                  (ly (for/sum ((r (range 0 nh)))
                        (for/sum ((c (range 0 sep))) (if (= (at ng r c) 4) 1 0))))
                  (ry (for/sum ((r (range 0 nh)))
                        (for/sum ((c (range (+ sep 1) nw))) (if (= (at ng r c) 4) 1 0))))
                  (yl (> ly ry))
                  (result (build-grid nh
                                      nw
                                      (r c)
                                      (let* ((v (at ng r c))
                                             (yr (if yl
                                                     (range 0 sep)
                                                     (range (+ sep 1) nw)))
                                             (rr (if yl
                                                     (range (+ sep 1) nw)
                                                     (range 0 sep)))
                                             (yc (filter (lambda (c2)
                                                           (= (at ng r c2) 4))
                                                         yr))
                                             (hy (> (length yc) 0))
                                             (rc (filter (lambda (c2)
                                                           (= (at ng r c2) 2))
                                                         rr))
                                             (nr (length rc)))
                                        (if hy
                                            (cond
                                              ((= v 4) 3)
                                              ((= c sep) 8)
                                              ((and
                                                 yl
                                                 (< c sep)
                                                 (> c (nth yc (- (length yc) 1)))) 4)
                                              ((and (not yl) (> c sep) (< c (first yc))) 4)
                                              ((and yl (> c sep) (< c (- nw nr))) 8)
                                              ((and (not yl) (< c sep) (>= c nr)) 8)
                                              ((and yl (>= c (- nw nr))) 2)
                                              ((and (not yl) (< c nr)) 2)
                                              (else v))
                                            v)))))
             (if is-horiz (transpose result) result)))))

Provenance

Generator
generators/8c12816521a2/generator.py
Notes and decisions
generators/8c12816521a2/notes.md
Review label
reviewed_safe
Generator SHA-256
5fd1dee61a1834b2f949ee08fe810fc5d9ce4207f1ae6200d1eac22e23d393ec
Rule hash
bdca6d13f74f
Sources
training
Lesson seeds
20261108, 20261109, 20261110, 20261111, 20261112
Reproduce lesson 1
arcpuzzles generate 8c12816521a2 --count 1 --seed 20261108 --test 1