← 2376352117fc · 23c3ab5fa55f →
23a0c42b8a1c
Crop the smallest shape cardinally adjacent to the color-1 marker and recolor its cells to 8.
adjacencycroppingmarker selection
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 (adjacent? grid a b) (any? (lambda (p) (any? (lambda (d) (member (list (+ (first p) (first d)) (+ (second p) (second d))) (obj-cells b))) cardinal-deltas)) (obj-cells a))) (define (neighbors grid objs i) (filter (lambda (j) (and (not (= i j)) (adjacent? grid (list-ref objs i) (list-ref objs j)))) (range 0 (length objs)))) (define (union-cells objs ids) (apply append (map (lambda (i) (obj-cells (list-ref objs i))) ids))) (define (extract-union grid objs ids color) (let* ((cells (union-cells objs ids)) (bb (bbox-of-cells cells)) (h (+ 1 (- (third bb) (first bb)))) (w (+ 1 (- (fourth bb) (second bb))))) (grid-from-fn h w (lambda (r c) (let ((p (list (+ (first bb) r) (+ (second bb) c)))) (if (member p cells) color 0)))))) (define objs (objects g 0)) (define marker (first (filter (lambda (i) (= (obj-color (list-ref objs i)) 1)) (range 0 (length objs))))) (define target (first (sort (neighbors g objs marker) (lambda (a b) (let ((oa (list-ref objs a)) (ob (list-ref objs b))) (if (= (obj-size oa) (obj-size ob)) (cell< (top-left oa) (top-left ob)) (< (obj-size oa) (obj-size ob)))))))) (extract-union g objs (list target) 8)))
Provenance
- Generator
- generators/23a0c42b8a1c/generator.py
- Notes and decisions
- generators/23a0c42b8a1c/notes.md
- Review label
- reviewed_safe
- Generator SHA-256
- 4b188d05f3c1b39b65cc288a07b39bef527b623df6a759f6facde2cda9cab75b
- Rule hash
- 5af80c67d390
- Sources
- bank:3a1815be7c2e
- Lesson seeds
- 20261108, 20261109, 20261110, 20261111, 20261112
- Reproduce lesson 1
arcpuzzles generate 23a0c42b8a1c --count 1 --seed 20261108 --test 1