← 91b531b5d3f4 · 91ba301501c5 →

91ba253f9945

Rotate source-local 8/9 markers a quarter-turn into a second local frame.

parametric familycoordinate transforms, multicolor motifs, rotated transport

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!
 ;; Two orthogonal color tripods act as coordinate frames. The SOURCE frame
 ;; is a 2-cell whose 3-neighbor gives the x axis and 4-neighbor the y axis;
 ;; the TARGET frame is a 5-cell with 6 and 7 likewise. Marker cells (colors
 ;; 8/9) within Chebyshev radius 3 of the source origin -- measured in
 ;; source-local coordinates -- are rotated 90 degrees and painted at the
 ;; matching target-local positions. The rest of the grid is unchanged.
 (lambda (g)
   (let ()
     (define (lex< a b)  ;; lexicographic over equal-length number lists
       (cond ((null? a) #f)
             ((not (= (first a) (first b))) (< (first a) (first b)))
             (else (lex< (rest a) (rest b)))))
     (define (find-frame a b c)  ;; -> (origin vx vy), lex-first candidate
       (first
        (sort (remove-duplicates
               (filter values
                       (for*/list ((r (range h)) (col (range w))
                                   (dx cardinal-deltas) (dy cardinal-deltas))
                         (and (= (at g r col) a)
                              (in-bounds? (+ r (first dx)) (+ col (second dx)) h w)
                              (in-bounds? (+ r (first dy)) (+ col (second dy)) h w)
                              (= (at g (+ r (first dx)) (+ col (second dx))) b)
                              (= (at g (+ r (first dy)) (+ col (second dy))) c)
                              (zero? (+ (* (first dx) (first dy))
                                        (* (second dx) (second dy))))
                              (list (list r col) dx dy)))))
              (lambda (fa fb)
                (lex< (append (first fa) (second fa) (third fa))
                      (append (first fb) (second fb) (third fb)))))))
     (define (lpos f r c)  ;; grid position -> frame-local (u v)
       (let ((dr (- r (first (first f))))
             (dc (- c (second (first f)))))
         (list (+ (* dr (first (second f))) (* dc (second (second f))))
               (+ (* dr (first (third f))) (* dc (second (third f)))))))
     (define (gpos f u v)  ;; frame-local (u v) -> grid position
       (list (+ (first (first f))
                (* u (first (second f))) (* v (first (third f))))
             (+ (second (first f))
                (* u (second (second f))) (* v (second (third f))))))
     (define src (find-frame 2 3 4))
     (define tgt (find-frame 5 6 7))
     (define pts  ;; (u v color) markers near the source origin, sorted
       (sort (filter values
                     (for*/list ((r (range h)) (c (range w)))
                       (and (member? (at g r c) (list 8 9))
                            (let ((uv (lpos src r c)))
                              (and (<= (max (abs (first uv)) (abs (second uv))) 3)
                                   (list (first uv) (second uv) (at g r c)))))))
             lex<))
     (for/fold ((out g)) ((p pts))  ;; rotate (u v) -> (-v u), paint at target
       (let ((rc (gpos tgt (- (second p)) (first p))))
         (set-cell out (first rc) (second rc) (third p)))))))

Provenance

Generator
generators/91ba253f9945/generator.py
Notes and decisions
generators/91ba253f9945/notes.md
Review label
reviewed_safe
Generator SHA-256
49685cefde62c79a7ec26688b5d61bbdeca25dbab460b60d48a23f994053bec5
Rule hash
b1e5584ad797
Sources
bank:f05110b6a734
Lesson seeds
20261108, 20261109, 20261110, 20261111, 20261112
Reproduce lesson 1
arcpuzzles generate 91ba253f9945 --count 1 --seed 20261108 --test 1