← e9905db3a38d · e9be57a9c56d →

e99db71ae23d

Project each gray L-tromino one diagonal step toward its missing corner in yellow, and each red L-tromino one step away in green; clip at edges and let green overwrite yellow on projection collisions.

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)))
           (let ((visited (make-hash))
                 (pieces (list)))
             (for* ((r (range 0 h)) (c (range 0 w)))
                   (when
                     (and
                       (or (= (at g r c) 2) (= (at g r c) 5))
                       (not (hash-has-key? visited (list r c))))
                     (let ((color (at g r c)))
                       (let bfs
                            ((queue (list (list r c))) (cells (list)))
                            (cond
                              ((null? queue) (set! pieces (append pieces (list (list color cells)))))
                              (else (let ((cr (first (car queue)))
                                          (cc (second (car queue))))
                                      (if (or
                                            (hash-has-key? visited (list cr cc))
                                            (< cr 0)
                                            (>= cr h)
                                            (< cc 0)
                                            (>= cc w)
                                            (!= (at g cr cc) color))
                                          (bfs (cdr queue) cells)
                                          (begin
                                            (hash-set! visited (list cr cc) #t)
                                            (bfs (append (cdr queue)
                                                         (list (list (- cr 1) cc)
                                                               (list (+ cr 1) cc)
                                                               (list cr (- cc 1))
                                                               (list cr (+ cc 1))))
                                                 (cons (list cr cc) cells)))))))))))
             (let ((result (make-hash)))
               (for* ((r (range 0 h)) (c (range 0 w)))
                     (hash-set! result (list r c) (at g r c)))
               (for ((pass-info (list (list 5 4) (list 2 3))))
                 (let ((pass-color (first pass-info))
                       (fill-color (second pass-info)))
                   (for ((piece pieces))
                     (when
                       (= (first piece) pass-color)
                       (let* ((cells (second piece))
                              (rmin (min-of first cells))
                              (cmin (min-of second cells))
                              (rmax (max-of first cells))
                              (cmax (max-of second cells))
                              (cell-set (make-hash)))
                         (for ((c cells)) (hash-set! cell-set c #t))
                         (let* ((opening (find (lambda (p)
                                                 (not (hash-has-key? cell-set p)))
                                               (list (list rmin cmin)
                                                     (list rmin cmax)
                                                     (list rmax cmin)
                                                     (list rmax cmax))))
                                (or2 (first opening))
                                (oc (second opening))
                                (dr (if (> (* 2 or2) (+ rmin rmax)) 1 -1))
                                (dc (if (> (* 2 oc) (+ cmin cmax)) 1 -1))
                                (sdr (if (= pass-color 5) dr (- 0 dr)))
                                (sdc (if (= pass-color 5) dc (- 0 dc))))
                           (for ((cell cells))
                             (let ((nr (+ (first cell) sdr))
                                   (nc (+ (second cell) sdc)))
                               (when
                                 (and (>= nr 0) (< nr h) (>= nc 0) (< nc w))
                                 (hash-set! result (list nr nc) fill-color))))))))))
               (cellmap g (r c v) (hash-ref result (list r c) 0)))))))

Provenance

Generator
generators/e99db71ae23d/generator.py
Notes and decisions
generators/e99db71ae23d/notes.md
Review label
reviewed_safe
Generator SHA-256
c811b7c51c933fbdd410606ad97d98fec6d2f85046c88ecca6b5b4b8e04a01dd
Rule hash
32f38f665cc3
Sources
augmented, training
Lesson seeds
20261108, 20261109, 20261110, 20261111, 20261112
Reproduce lesson 1
arcpuzzles generate e99db71ae23d --count 1 --seed 20261108 --test 1