[ prog / sol / mona ]

prog


The Forced Indentation Of Code

59 2022-03-24 21:15

upgrade of >>55 with a coordinate painting function

scheme@(guile-user)> (display ((lambda (rec xjoin pred symbol index cell E chars band separ step lines columns) ((lambda (xjoin lines columns bottom right cycle) ((lambda (E chars pred) ((lambda (symbol) (xjoin lines (lambda (k) (string-append (xjoin columns (lambda (j) (symbol k j)) separ) "\n")) "")) (lambda (k j) (if (pred k j) E (symbol chars cell cycle (index band k j)))))) (xjoin cell (lambda (k) E) "") (xjoin (* cell cycle) (lambda (x) ((lambda (idx) (substring chars idx (+ idx 1))) (quotient x cell))) "") ((lambda (lines columns) (lambda (k j) (pred step lines columns bottom right k j))) (- lines 1) (- columns 1)))) (lambda (n fun sep) (rec xjoin n fun sep "")) (+ 1 (* step lines)) (+ 1 (* step columns)) (if (even? lines) odd? even?) (if (odd? columns) odd? even?) (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 (test) (lambda (step lines columns bottom right k j) (or (zero? (modulo (+ k j) step)) (test step j even? k 0) (test step k odd? j 0) (test step j bottom k lines) (test step k right j columns)))) (lambda (step var test fix limit) (and (= fix limit) (test (quotient var step))))) (lambda (chars cell cycle index) ((lambda (idx) (substring chars idx (+ idx cell))) (* cell (modulo index cycle)))) (lambda (band k j) (quotient j band)) 2 "❀" "░▒▓█▓▒" 3 "" 3 6 11))

the output takes the post over the 413 Request Entity Too Large limit so it goes up separately

larger version with colors: http://paste.textboard.org/2651c14c/raw

267


VIP:

do not edit these