← c286f4a2923f · c2b9484357c1 →

c2a1ba1a45fd

Use the gray legend's ordered colored cells to recolor ordered external objects of the outside-dominant source color.

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))
               (grays (find-color g 5)))
           (let ((gr0 (min-list (map fst grays)))
                 (gc0 (min-list (map snd grays)))
                 (gr1 (max-list (map fst grays)))
                 (gc1 (max-list (map snd grays))))
             (let ((sc (fst (reduce (lambda (best c)
                                      (let ((cnt (length (filter (lambda (p)
                                                                   (not (and
                                                                          (>= (fst p)
                                                                              gr0)
                                                                          (<= (fst p)
                                                                              gr1)
                                                                          (>= (snd p)
                                                                              gc0)
                                                                          (<= (snd p)
                                                                              gc1))))
                                                                 (find-color g c)))))
                                        (if (> cnt (snd best)) (list c cnt) best)))
                                    (list 0 0)
                                    (range 1 10)))))
               (let ((dots (sort-by (filter (lambda (d) (not (= (nth d 2) 0)))
                                            (reduce (lambda (acc r)
                                                      (reduce (lambda (a c)
                                                                (let ((v (at g r c)))
                                                                  (if (and
                                                                        (not (= v 0))
                                                                        (not (= v 5))
                                                                        (not (= v sc)))
                                                                      (append a
                                                                              (list (list r
                                                                                          c
                                                                                          v)))
                                                                      a)))
                                                              acc
                                                              (range gc0 (+ gc1 1))))
                                                    (list)
                                                    (range gr0 (+ gr1 1))))
                                    (lambda (d) (+ (* 1000 (fst d)) (snd d))))))
                 (let ((objs (sort-by (filter (lambda (o)
                                                (and
                                                  (= (obj-color o) sc)
                                                  (not (for/or ((cell (obj-cells o)))
                                                               (and
                                                                 (>= (fst cell) gr0)
                                                                 (<= (fst cell) gr1)
                                                                 (>= (snd cell) gc0)
                                                                 (<= (snd cell) gc1))))))
                                              (objects-8 g 0))
                                      (lambda (o)
                                        (+ (* 1000 (min-list (map fst (obj-cells o))))
                                           (min-list (map snd (obj-cells o))))))))
                   (reduce (lambda (acc i)
                             (if (>= i (min (length dots) (length objs)))
                                 acc
                                 (let ((color (nth (nth dots i) 2))
                                       (cells (obj-cells (nth objs i))))
                                   (reduce (lambda (a cell)
                                             (set-cell a (fst cell) (snd cell) color))
                                           acc
                                           cells))))
                           g
                           (range 0 (min (length dots) (length objs)))))))))))

Provenance

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