← 78f3cf31c4bf · 79353e95283d →

78fd2bcdbb99

A grid is almost symmetric left/right or up/down. Count mismatches for both axes, choose the axis with fewer mismatches (left/right on a tie), then restore empty cells from their nonzero mirrors. Patterns may use one or several colors.

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 (grid)
  (let* ((height (rows grid))
         (width (cols grid)))
    (define (lr-mirror row col)
      (cell-at grid row (- (- width 1) col)))
    (define (ud-mirror row col)
      (cell-at grid (- (- height 1) row) col))
    (define lr-mismatches
      (for/sum (row (range 0 height))
        (for/sum (col (range 0 width))
          (if (= (cell-at grid row col) (lr-mirror row col)) 0 1))))
    (define ud-mismatches
      (for/sum (row (range 0 height))
        (for/sum (col (range 0 width))
          (if (= (cell-at grid row col) (ud-mirror row col)) 0 1))))
    (define use-lr (not (> lr-mismatches ud-mismatches)))
    (grid-from-fn height width
      (lambda (row col)
        (let ((value (cell-at grid row col))
              (mirror (if use-lr (lr-mirror row col) (ud-mirror row col))))
          (if (and (= value 0) (!= mirror 0)) mirror value)))))))

Provenance

Generator
generators/78fd2bcdbb99/generator.py
Notes and decisions
generators/78fd2bcdbb99/notes.md
Review label
reviewed_safe
Generator SHA-256
e17c1d9b73f4ed0ed4aed61ef262f603b65a6f116e546ad27571a1a5ab01065f
Rule hash
512174df5e11
Sources
custom
Lesson seeds
20261108, 20261109, 20261110, 20261111, 20261112
Reproduce lesson 1
arcpuzzles generate 78fd2bcdbb99 --count 1 --seed 20261108 --test 1