[ prog / sol / mona ]

prog


The Forced Indentation Of Code

67 2022-04-09 10:33

While the structure of the Hilbert >>28 and Peano curves is different, the structure of their structure is the same, and to underscore this point the only changes are in the constants used by the lambdas.

>>> print ((lambda mY, xjoin, size, getch, patch, cell, expand, cellx, celly, cells, chars, start, n: (lambda xjoin, cell, n, symbol: (lambda boot: xjoin (celly * n, lambda k: xjoin (cellx * n, lambda j: boot (n, k, j), ''), '\n')) (lambda n, k, j: (lambda dk, mk, dj, mj: (lambda cin, key, cout: symbol (cin, key, cout, mk, mj)) (* cell (start [0], start [1 : 3], start [3], dk, dj, n // 3))) (* (divmod (k, celly) + divmod (j, cellx))))) (mY (xjoin), mY (cell, expand, patch), size (n), lambda cin, key, cout, dk, dj: (lambda idx: (lambda key: getch (chars, patch (key [0], cin, cout) + key [1])) (cells [key] [idx : idx + 2])) (2 * (cellx * dk + dj)))) (lambda f, *more: (lambda x: x (x)) (lambda y: f (lambda *args: y (y) (*args), *more)), lambda f: lambda n, g, s: '' if n <= 0 else g (0) if n == 1 else f (n - 1, g, s) + s + g (n - 1), lambda n: 3 ** n, lambda chars, key: chars.get (key) or chars [key [::-1]], lambda ch, cin, cout: cin if ch == 'i' else cout if ch == 'o' else ch, lambda f, expand, patch: lambda cin, key, cout, k, j, n: (cin, key, cout) if n == 0 else (lambda dk, mk, dj, mj: (lambda idx: (lambda iko: f (patch (iko [0], cin, cout), iko [1 : 3], patch (iko [3], cin, cout), mk, mj, n // 3)) (expand [key] [idx : idx + 4])) (4 * (3 * dk + dj))) (* (divmod (k, n) + divmod (j, n))), {"en": "ienewesewensewnsewswnwnwneneweseweno", "es": "sesewenewesoewsnewnwswswiesewenewesn", "wn": "ewnsewswiwnwnenewesewensewnoewswnwnw", "ws": "ewsoewnwswswsesewenewesnewsnewnwiwsw"}, 4, 3, {"en": "ieewewwsesewewwnneewewow", "es": "seewewowneewewswieewewnw", "wn": "seewewiwneewewswoeewewnw", "ws": "oeewewwsesewewwnneewewiw"}, {"ns": '│', "ne": '└', "nw": '┘', "se": '┌', "sw": '┐', "ew": '─'}, "wens", 2))

separate output for 413

larger version: http://paste.textboard.org/15be4df1/raw

267


VIP:

do not edit these