← 76b6aec98a7c · 76e0bd03e098 →
76b818438a96
Two colored non-branching orthogonal paths (1..3 turns) and two aligned singleton markers. Extend each path toward its marker and recolor the same number of cells from the opposite endpoint in the marker color.
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* ((objs (objects g 0)) (markers (filter (lambda (o) (= (obj-size o) 1)) objs)) (shapes (filter (lambda (o) (> (obj-size o) 1)) objs))) (for/fold ((grid g)) ((shape shapes)) (let* ((color (obj-color shape)) (cells (obj-cells shape)) (in-shape? (lambda (r c) (let loop ((cs cells)) (cond ((null? cs) #f) ((and (= (first (car cs)) r) (= (second (car cs)) c)) #t) (else (loop (cdr cs))))))) (nbr-count (lambda (r c) (count-if (lambda (d) (in-shape? (+ r (first d)) (+ c (second d)))) cardinal-deltas))) (get-nbr (lambda (r c) (let ((d (find-first (lambda (delta) (in-shape? (+ r (first delta)) (+ c (second delta)))) cardinal-deltas))) (list (+ r (first d)) (+ c (second d)))))) (endpoints (filter (lambda (cell) (= (nbr-count (first cell) (second cell)) 1)) cells)) (find-marker (lambda (r c dr dc) (let loop ((rr (+ r dr)) (cc (+ c dc))) (cond ((not (in-bounds? rr cc h w)) #f) (else (let mloop ((ms markers)) (cond ((null? ms) (loop (+ rr dr) (+ cc dc))) (else (let ((mc (first (obj-cells (car ms))))) (if (and (= (first mc) rr) (= (second mc) cc)) (list (car ms) rr cc) (mloop (cdr ms)))))))))))) (ext-info (let loop ((eps endpoints)) (cond ((null? eps) #f) (else (let* ((ep (car eps)) (r (first ep)) (c (second ep)) (nb (get-nbr r c)) (dr (- r (first nb))) (dc (- c (second nb))) (found (find-marker r c dr dc))) (if found (list ep dr dc (first found) (second found) (third found)) (loop (cdr eps)))))))) (ep (first ext-info)) (dr (second ext-info)) (dc (third ext-info)) (marker (fourth ext-info)) (mr (fifth ext-info)) (mc (sixth ext-info)) (mcol (obj-color marker)) (other-ep (if (equal? ep (first endpoints)) (second endpoints) (first endpoints))) (ext-cells (let loop ((rr (+ (first ep) dr)) (cc (+ (second ep) dc)) (acc (list))) (if (and (= rr mr) (= cc mc)) (reverse acc) (loop (+ rr dr) (+ cc dc) (cons (list rr cc color) acc))))) (ext-count (length ext-cells)) (recolor-cells (let loop ((curr other-ep) (prev #f) (acc (list)) (n 0)) (cond ((>= n ext-count) (reverse acc)) (else (let* ((r (first curr)) (c (second curr)) (new-acc (cons (list r c mcol) acc)) (next (let delta-loop ((ds cardinal-deltas)) (cond ((null? ds) #f) (else (let* ((d (car ds)) (nr (+ r (first d))) (nc (+ c (second d))) (nn (list nr nc))) (if (and (in-shape? nr nc) (or (not prev) (not (equal? nn prev)))) nn (delta-loop (cdr ds))))))))) (if next (loop next curr new-acc (+ n 1)) (reverse new-acc)))))))) (paint-cells grid (append ext-cells recolor-cells))))))))
Provenance
- Generator
- generators/76b818438a96/generator.py
- Notes and decisions
- generators/76b818438a96/notes.md
- Review label
- reviewed_safe
- Generator SHA-256
- 36333edb8162ad82300af823d21f9e0fd8e04852194a2f1336599dc41f428c42
- Rule hash
- 000a1e2b0988
- Sources
- augmented, training
- Lesson seeds
- 20261108, 20261109, 20261110, 20261111, 20261112
- Reproduce lesson 1
arcpuzzles generate 76b818438a96 --count 1 --seed 20261108 --test 1