[ prog / sol / mona ]

prog


The Forced Indentation Of Code

149 2022-07-30 10:50

Upgrade of >>139 with intrapatch rendering, with half-triangles that align with their half of the quadrant as an example.

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 (patch band cycle n k j) ((lambda (k j) ((lambda (dx dy) (if (or (= dx 0) (= dy 0)) 0 (+ (patch (- cycle 1) (quotient (- (+ k j) dx) band) (quotient (- (- k j) dy) band) dx dy band) 1))) (modulo (+ k j) band) (modulo (- k j) band))) (- k n) (- j (* 2 n)))) ((lambda (halfcell) ((lambda (quadrant) (lambda (cycle x y dx dy band) (modulo (if (and (>= x 1) (<= (- x) y (- x 1))) (if (quadrant (if (>= y 0) (- -1 y) (- y)) (- x 1) (- band dy) dx band) 1 0) (if (and (<= y -2) (<= (+ y 1) x (- -2 y))) (if (quadrant (if (>= x 0) (- -1 x) (- x)) (- -2 y) (- band dx) (- band dy) band) 2 0) (if (and (<= x -2) (<= (+ x 1) y (- -2 x))) (if (quadrant (if (>= y 0) (+ y 1) y) (- -2 x) dy (- band dx) band) 3 0) (if (and (>= y 1) (<= (- y) x (- y 1))) (if (quadrant (if (>= x 0) (+ x 1) x) (- y 1) dx dy band) 4 0) 0)))) cycle))) (lambda (x y dx dy band) (halfcell dx dy band (if (< x 0) -1 1))))) (lambda (dx dy band lr) (if (< lr 0) (<= (- band dx) dy) (if (> lr 0) (<= dx dy) #f)))) "🌵🌹🌺🌼🌸🌻🌷💮" 6 9))

separate output >>148 for 413 >>127

larger version: http://0x0.st/ojhO.txt https://wirechan.org/b/res/2162.html#3732

in the next episode: >>21

267


VIP:

do not edit these