[ prog / sol / mona ]

prog


The Forced Indentation Of Code

218 2022-11-08 11:26

Port of >>119 to the connector flower garden >>208.

scheme@(guile-user)> (display ((lambda (rec xjoin extract cell index connector connectors chars band columnfactor n) ((lambda (xjoin cell connector lines columns cycle) ((lambda (patch) ((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 columnfactor n k j) 1)))) (lambda (cycle x y dx dy band) (if (connector (cell x y) dx dy) 1 0)))) (lambda (n fun sep) (rec xjoin n fun sep "")) ((lambda (shift) (lambda (x y) (shift (cell x y)))) (lambda (x) (if (< x 3) x (+ x 4)))) (connector connectors band) (+ (* 2 n) 1) (+ (* 2 columnfactor 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 (half) (lambda (j k) (apply (lambda (k up j left) ((lambda (jd jm) (if (<= jd (- k 2)) 1 (if (= jd (- k 1)) (if (= jm 1) (if up 3 4) 1) (if (= jd k) (if (= jm 0) 1 (if (= jm 1) (if left 6 5) 0)) (if (= jm 1) 2 0))))) (quotient j 3) (modulo j 3))) `(,@(half k) ,@(half j))))) (lambda (k) (if (< k 0) `(,(- -1 k) #t) `(,k #f)))) (lambda (patch band cycle columnfactor 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 (* columnfactor n)))) (lambda (spec band) ((lambda (b2 on) (lambda (index dx dy) (if (zero? index) #f ((lambda (bits) (or (and (= dy b2) (or (= dx b2) (on 0 bits) (and (< dx b2) (on 1 bits)) (and (> dx b2) (on 2 bits)))) (and (= dx b2) (or (on 3 bits) (and (< dy b2) (on 4 bits)) (and (> dy b2) (on 5 bits)))))) (vector-ref spec index))))) (quotient band 2) logbit?)) #(#f 1 8 36 34 20 18 33 17 10 12) "🌵🌹🌺🌼🌸🌻🌷💮🦋" 6 2 9))

separate output >>217 for renewed 413 >>127

larger version: https://wirechan.org/b/res/2162.html#4366 http://paste.textboard.org/ea001243/raw

267


VIP:

do not edit these