← 80a3c4f25880 · 80f776fb3ce5 →

80bd3177b03c

Generate two-marker colors on clear, nonintersecting horizontal and/or vertical segments. The first three default examples cover horizontal, vertical, and mixed orientations; the exact rule connects only colors occurring twice on a clear aligned path.

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 (same-pos? a b)
      (and (= (fst a) (fst b)) (= (snd a) (snd b))))
    (define (point< a b)
      (or (< (fst a) (fst b))
          (and (= (fst a) (fst b)) (< (snd a) (snd b)))))
    (define (ordered-pair pts)
      (let ((a (first pts)) (b (second pts)))
        (if (point< b a) (list b a) (list a b))))
    (define colors (filter (lambda (color) (= (length (find-color g color)) 2)) (grid-colors g 0)))
    (define records
      (sort
        (map (lambda (color)
               (let ((pts (ordered-pair (find-color g color))))
                 (list color (first pts) (second pts))))
             colors)
        (lambda (x y) (point< (second x) (second y)))))
    (define (range-between a b)
      (if (<= a b) (range a (+ b 1)) (range a (- b 1) -1)))
    (define (clear-path? cells a b)
      (all?
        (lambda (p)
          (or (same-pos? p a) (same-pos? p b) (= (cell-at g (fst p) (snd p)) 0)))
        cells))
    (define (segment rec)
      (let* ((color (first rec))
             (a (second rec))
             (b (third rec))
             (cells
              (cond
                [(= (fst a) (fst b))
                 (map (lambda (c) (list (fst a) c color)) (range-between (snd a) (snd b)))]
                [(= (snd a) (snd b))
                 (map (lambda (r) (list r (snd a) color)) (range-between (fst a) (fst b)))]
                [else (list)])))
        (if (clear-path? cells a b) cells (list))))
    (paint-cells g (flatmap segment records))))

Provenance

Generator
generators/80bd3177b03c/generator.py
Notes and decisions
generators/80bd3177b03c/notes.md
Review label
reviewed_safe
Generator SHA-256
27174840cc1faa70abf8693de411ee1c862832ab0062617127649114a1e42ac4
Rule hash
e3926fa15421
Sources
bank:0d41ded5f4cd
Lesson seeds
20261108, 20261109, 20261110, 20261111, 20261112
Reproduce lesson 1
arcpuzzles generate 80bd3177b03c --count 1 --seed 20261108 --test 1