[ prog / sol / mona ]

prog


The Forced Indentation Of Code

129 2022-07-14 12:27

Spiral >>126 Flower Garden >>122

scheme@(guile-user)> (display ((lambda (rec xjoin extract index patch chars band n) ((lambda (xjoin lines columns cycle) ((lambda (symbol) (xjoin lines (lambda (k) (string-append (xjoin columns (lambda (j) (symbol k j)) "") "\n")) "")) (lambda (k j) (extract chars (index patch band cycle n k j) 1)))) (lambda (n fun sep) (rec xjoin n fun sep "")) (+ (* 2 n) 1) (+ (* 4 n) 1) (string-length chars))) (lambda (f . args) (apply f (cons f args))) (lambda (self n fun sep acc) (if (<= n 0) "" (if (= n 1) (string-append (fun 0) acc) (self self (- n 1) fun sep (string-append sep (fun (- n 1)) acc))))) (lambda (str pos len) (substring str pos (+ pos len))) ((lambda (div) (lambda (patch band cycle n k j) ((lambda (k j) (if (or (= (modulo (+ k j) band) 0) (= (modulo (- k j) band) 0)) 0 (+ (patch (- cycle 1) (div (+ k j) band) (div (- k j) band)) 1))) (- k n) (- j (* 2 n))))) (lambda (a b) (quotient (- a (modulo a b)) b))) ((lambda (spiral) (lambda (cycle x y) (modulo (spiral x y) cycle))) ((lambda (ring inside inring) (lambda (k j) ((lambda (ring) (+ (inside ring) (inring ring k j))) (ring k j)))) (lambda (k j) (quotient (+ (max (abs (+ (* 2 k) 1)) (abs (+ (* 2 j) 1))) 1) 2)) (lambda (ring) (if (< ring 2) 0 (* 4 (- ring 1) (- ring 1)))) (lambda (ring k j) (if (= k (- ring)) (+ (* 7 ring) -4 j) (if (= j (- ring)) (- (* 5 ring) 4 k) (if (= k (- ring 1)) (- (* 3 ring) 3 j) (+ ring -1 k))))))) "🌵🌹🌺🌷🌻💮🌼🌸" 6 9))

separate output >>128 for 413 >>127

larger version: http://paste.textboard.org/7f304d10/raw
apply
* { line-height: 1em; }
to the larger version for more symmetry

in the next episode: >>17

267


VIP:

do not edit these