← 8eeb98656c43 · 8f10b83435aa →
8ef6f191186d
Read a palette mapping and geometric command from the two-row header, then remap, transform, and tightly crop the object below.
command compositioncropped outputpalette permutation
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).
Reference rule (Racket)
(rule!
(let ((code (at g 0 0)))
(define (apply-cmd grid code)
(cond [(= code 1) grid]
[(= code 2) (rotate-cw grid)]
[(= code 3) (rotate-180 grid)]
[(= code 4) (rotate-ccw grid)]
[(= code 5) (flip-lr grid)]
[(= code 6) (flip-ud grid)]
[else (transpose grid)]))
(define (after-two xs) (rest (rest xs)))
(define (lookup v pairs)
(cond [(empty? pairs) #f]
[(= v (first (first pairs))) (second (first pairs))]
[else (lookup v (rest pairs))]))
(define src (filter (lambda (v) (not (= v 0))) (after-two (row g 0))))
(define tgt (filter (lambda (v) (not (= v 0))) (after-two (row g 1))))
(define mapping (map list src tgt))
(define obj (crop-to-content (subgrid g 2 0 (- (rows g) 1) (- (cols g) 1))))
(define remapped
(grid-from-fn (rows obj) (cols obj)
(lambda (r c)
(let* ((v (at obj r c))
(hit (lookup v mapping)))
(if (and (not (= v 0)) hit) hit v)))))
(crop-to-content (apply-cmd remapped code))))Provenance
- Generator
- generators/8ef6f191186d/generator.py
- Notes and decisions
- generators/8ef6f191186d/notes.md
- Review label
- reviewed_safe
- Generator SHA-256
- 026832d89d8b0b42f57205d638c91491de5c48927ec686c3ae8ec2a6723f9d15
- Rule hash
- 84c7e6d399c7
- Sources
- bank:fd166f81148e
- Lesson seeds
- 20261108, 20261109, 20261110, 20261111, 20261112
- Reproduce lesson 1
arcpuzzles generate 8ef6f191186d --count 1 --seed 20261108 --test 1