← public_eval_7491f3cf · public_eval_78332cb0 →

public_eval_7666fa5d

No summary in the catalog.

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!
 ;; Uniform northeast/southwest strokes bound continuous diagonal spans.
 ;; A stroke is measured by u=r+c, its inclusive range of v=r-c, and length.
 ;; Paint a cyan cell red when one stroke lies on each side in u and both
 ;; continuous spans contain its v. Brackets need not be adjacent. Original
 ;; stroke cells stay unchanged, including strokes inside a filled region.
 (lambda (g)
  (let ()
   (define length-match? #f)
   (define adjacent-only? #f)
   (define first-pair-only? #f)
   (define longest-only? #f)
   (define exact-rays? #f)
   (define union-spans? #f)
   (define preserve-strokes? #t)
   (define same-color? #f)
   (define max-length 60)
   (define point-spans? #f)
   (define measured
    (for*/list ((r (range h)) (c (range w))
     #:when (and (not (= (at g r c) 8))
                  (not (= (safe-at g (- r 1) (+ c 1) 8) (at g r c)))))
      (let ((color (at g r c)))
       (let loop ((rr r) (cc c))
        (if (= (safe-at g (+ rr 1) (- cc 1) 8) color)
            (loop (+ rr 1) (- cc 1))
            (list (+ r c) (- r c) (if point-spans? (- r c) (- rr cc)) (+ 1 (- rr r)) color))))))
   (define ordered
    (sort measured (lambda (a b) (or (< (first a) (first b))
          (and (= (first a) (first b)) (< (second a) (second b)))))))
   (define maximum (apply max (cons 0 (map fourth ordered))))
   (define eligible
    (filter (lambda (s) (and (<= (fourth s) max-length)
                        (or (not longest-only?) (= (fourth s) maximum)))) ordered))
   (define segments (if first-pair-only? (take eligible (min 2 (length eligible))) eligible))
   (for/list ((r (range h)))
    (for/list ((c (range w)))
     (define u (+ r c))
     (define v (- r c))
     (if (and (or (not preserve-strokes?) (= (at g r c) 8))
          (for/or ((i (range (length segments))))
           (define left (nth segments i))
           (and (< (first left) u)
            (for/or ((j (range (+ i 1) (length segments))))
             (define right (nth segments j))
             (define low (if union-spans? (min (second left) (second right)) (max (second left) (second right))))
             (define high (if union-spans? (max (third left) (third right)) (min (third left) (third right))))
             (and (< u (first right))
                  (or (not adjacent-only?) (= j (+ i 1)))
                  (or (not length-match?) (= (fourth left) (fourth right)))
                  (or (not same-color?) (= (nth left 4) (nth right 4)))
                  (<= low v high)
                  (or (not exact-rays?)
                      (and (= (modulo (- v (second left)) 2) 0)
                           (= (modulo (- v (second right)) 2) 0))))))))
       2 (at g r c)))))))

Provenance

Generator
generators/public_eval_7666fa5d/generator.py
Notes and decisions
generators/public_eval_7666fa5d/notes.md
Review label
reviewed_safe
Generator SHA-256
06db3499573dc50386745f73e392d746f65288c7a5073fa8c76d2da4a0209f18
Rule hash
e271803dfe43
Sources
evaluation, public_eval:7666fa5d
Lesson seeds
20261108, 20261109, 20261110, 20261111, 20261112
Reproduce lesson 1
arcpuzzles generate public_eval_7666fa5d --count 1 --seed 20261108 --test 1