← f29af9159005 · f2e717c7c250 →
f2dbde875127
Rotate each single-color object inside a blue rectangular frame by (key-2)*90 degrees clockwise, then center its bounding box. All keys 2..5, rectangular and square interiors, and 1..3 separated frames occur.
frame-wise transformslocal rotationrecentering
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! (let ((dummy 0)) (define (e8b-list< a b) (cond ((empty? a) #f) ((< (first a) (first b)) #t) ((> (first a) (first b)) #f) (else (e8b-list< (rest a) (rest b))))) (define (e8b-paste grid pat top left) (for*/fold ((out grid)) ((r (in-range (rows pat))) (c (in-range (cols pat)))) (let ((v (at pat r c)) (rr (+ top r)) (cc (+ left c))) (if (and (not (= v 0)) (in-bounds? rr cc (rows out) (cols out))) (set-cell out rr cc v) out)))) (define (f14-same-cells? a b) (and (= (length a) (length b)) (all? (lambda (p) (member? p b)) a))) (define (f14-border-cells r0 c0 r1 c1) (for*/list ((r (in-range r0 (+ r1 1))) (c (in-range c0 (+ c1 1))) #:when (or (= r r0) (= r r1) (= c c0) (= c c1))) (list r c))) (define (f4-norm cells) (let* ((bb (bbox-of-cells cells)) (r0 (first bb)) (c0 (second bb))) (map (lambda (p) (list (- (first p) r0) (- (second p) c0))) cells))) (define (f4-norm-info cells) (let* ((bb (bbox-of-cells cells)) (r0 (first bb)) (c0 (second bb)) (r1 (third bb)) (c1 (fourth bb))) (list (f4-norm cells) (+ 1 (- r1 r0)) (+ 1 (- c1 c0))))) (define (f4-rect-frame? cells) (let* ((info (f4-norm-info cells)) (norm (first info)) (h (second info)) (w (third info)) (border (f14-border-cells 0 0 (- h 1) (- w 1)))) (and (>= h 3) (>= w 3) (f14-same-cells? norm border)))) (define (s17-nonzero-values grid) (filter (lambda (v) (not (= v 0))) (apply append grid))) (define (s17-first-nonzero grid) (first (s17-nonzero-values grid))) (define (s7b-frame-boxes grid color) (map obj-bbox (sort (filter (lambda (obj) (and (= (obj-color obj) color) (f4-rect-frame? (obj-cells obj)))) (objects grid 0)) (lambda (a b) (e8b-list< (obj-bbox a) (obj-bbox b)))))) (define (s7b-inside box) (list (+ (first box) 1) (+ (second box) 1) (- (third box) 1) (- (fourth box) 1))) (define (s7b-crop-box grid box) (subgrid grid (first box) (second box) (third box) (fourth box))) (define (s7b-rotate-n grid n) (if (= n 0) grid (s7b-rotate-n (rotate-cw grid) (- n 1)))) (define (s7b-color-mask grid color) (grid-from-fn (rows grid) (cols grid) (lambda (r c) (if (= (at grid r c) color) color 0)))) (define (s7b-first-key-above grid box allowed) (let ((r (- (first box) 1))) (first (filter (lambda (v) (member? v allowed)) (map (lambda (c) (at grid r c)) (range (second box) (+ (fourth box) 1))))))) (for/fold ((out g)) ((box (in-list (s7b-frame-boxes g 1)))) (let* ((ibox (s7b-inside box)) (key (s7b-first-key-above g box (list 2 3 4 5))) (ir0 (first ibox)) (ic0 (second ibox)) (ir1 (third ibox)) (ic1 (fourth ibox)) (cells (filter (lambda (p) (not (= (at g (first p) (second p)) 0))) (positions-in-rect ir0 ic0 ir1 ic1))) (bb (bbox-of-cells cells)) (obj0 (s7b-crop-box g bb)) (color (s17-first-nonzero obj0)) (obj (s7b-rotate-n (s7b-color-mask obj0 color) (- key 2))) (top (+ ir0 (quotient (- (+ 1 (- ir1 ir0)) (rows obj)) 2))) (left (+ ic0 (quotient (- (+ 1 (- ic1 ic0)) (cols obj)) 2))) (cleared (paint-cells out (positions-in-rect ir0 ic0 ir1 ic1) 0))) (e8b-paste cleared obj top left)))))
Provenance
- Generator
- generators/f2dbde875127/generator.py
- Notes and decisions
- generators/f2dbde875127/notes.md
- Review label
- reviewed_safe
- Generator SHA-256
- b3adc8e5389ad39d70f4b5dd9828f3352f9de1195c9d67f29139c7d5c3e10b92
- Rule hash
- f0178b249d84
- Sources
- bank:50e2f7e22580
- Lesson seeds
- 20261108, 20261109, 20261110, 20261111, 20261112
- Reproduce lesson 1
arcpuzzles generate f2dbde875127 --count 1 --seed 20261108 --test 1