← 8881f54cf3c8 · 88b8e6aaa49d →

888fb4310749

Tile both diagonal periods with source-color blocks and adjacent rotated 9-minus-color blocks, clipping at the canvas.

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)))
           (begin
             (define cells (positions-of g (lambda (v) (!= v 0))))
             (define r0 (min-of first cells))
             (define r1 (max-of first cells))
             (define c0 (min-of second cells))
             (define c1 (max-of second cells))
             (define bh (+ 1 (- r1 r0)))
             (define bw (+ 1 (- c1 c0)))
             (define step (+ bh bw))
             (define color (at g r0 c0))
             (define alt (- 9 color))
             (define (intersects? rr cc hh ww)
               (and
                 (<= rr (- h 1))
                 (>= (+ rr hh -1) 0)
                 (<= cc (- w 1))
                 (>= (+ cc ww -1) 0)))
             (define (stamp-rect out rr cc hh ww v)
               (for*/fold ((acc out))
                          ((r (range rr (+ rr hh))) (c (range cc (+ cc ww)))
                            #:when
                            (in-bounds? r c h w))
                          (set-cell acc r c v)))
             (define same-anchors
               (remove-duplicates (filter identity
                                          (flatmap (lambda (k)
                                                     (map (lambda (sgn)
                                                            (let ((rr (+ r0 (* k step)))
                                                                  (cc (+ c0
                                                                         (* sgn k step))))
                                                              (and
                                                                (intersects? rr
                                                                             cc
                                                                             bh
                                                                             bw)
                                                                (list rr cc))))
                                                          (list 1 -1)))
                                                   (range -40 41)))))
             (define with-rotated
               (for*/fold ((out g))
                          ((k (range -40 41)) (sgn (list 1 -1)))
                          (let* ((rr (+ r0 (* k step)))
                                 (cc (+ c0 (* sgn k step)))
                                 (ar (+ rr bh))
                                 (ac (+ cc (if (= sgn 1) bw (- bh)))))
                            (if (intersects? ar ac bw bh)
                                (stamp-rect out ar ac bw bh alt)
                                out))))
             (for/fold ((out with-rotated))
               ((p same-anchors))
               (stamp-rect out (first p) (second p) bh bw color))))))

Provenance

Generator
generators/888fb4310749/generator.py
Notes and decisions
generators/888fb4310749/notes.md
Review label
reviewed_safe
Generator SHA-256
cf61a8a04194e393fda55318233daed0af194c0c9ee7f47e9377885d19779b0d
Rule hash
2e44fadee3f2
Sources
training
Lesson seeds
20261108, 20261109, 20261110, 20261111, 20261112
Reproduce lesson 1
arcpuzzles generate 888fb4310749 --count 1 --seed 20261108 --test 1