[ prog / sol / mona ]

prog


The Forced Indentation Of Code

55 2022-03-16 11:30

zigzag meme traversal

scheme@(guile-user)> (display ((lambda (rec xjoin pred s separ step lines columns) ((lambda (xjoin lines columns bottom right) ((lambda (z pred) (xjoin lines (lambda (k) (string-append (xjoin columns (lambda (j) (if (pred k j) s z)) separ) "\n")) "")) (xjoin (string-length s) (lambda (k) " ") "") ((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?))) (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))))) "me" "" 3 6 12))
memememe    memememe    memememe    memememe    memememe    memememe    me
    me    me    me    me    me    me    me    me    me    me    me    meme
  me    me    me    me    me    me    me    me    me    me    me    me  me
me    me    me    me    me    me    me    me    me    me    me    me    me
me  me    me    me    me    me    me    me    me    me    me    me    me  
meme    me    me    me    me    me    me    me    me    me    me    me    
me    me    me    me    me    me    me    me    me    me    me    me    me
    me    me    me    me    me    me    me    me    me    me    me    meme
  me    me    me    me    me    me    me    me    me    me    me    me  me
me    me    me    me    me    me    me    me    me    me    me    me    me
me  me    me    me    me    me    me    me    me    me    me    me    me  
meme    me    me    me    me    me    me    me    me    me    me    me    
me    me    me    me    me    me    me    me    me    me    me    me    me
    me    me    me    me    me    me    me    me    me    me    me    meme
  me    me    me    me    me    me    me    me    me    me    me    me  me
me    me    me    me    me    me    me    me    me    me    me    me    me
me  me    me    me    me    me    me    me    me    me    me    me    me  
meme    me    me    me    me    me    me    me    me    me    me    me    
me    memememe    memememe    memememe    memememe    memememe    memememe
scheme@(guile-user)> 
267


VIP:

do not edit these