patterns — tenprint

generator verdict no votes yet
source — gen_b.g11_tenprint
def g11_tenprint(rng):
    """TEN PRINT — the 1982 one-liner, rebuilt from half-blocks and biased by a
    smooth field so the maze acquires a direction of travel."""
    N = 32
    c = Canvas(N, "GLYPH", "glyph", "tenprint", tiles=False)
    NX, NY = c.cols, c.rows
    nz = Value2D(rng, res=rng.choice([3, 4, 5]))
    pairs = rng.choice([("▌", "▐"), ("▀", "▄"), ("▌", "▀"), ("▐", "▄")])
    heavy = rng.uniform(0.04, 0.16)
    light = rng.uniform(0.04, 0.16)
    tilt = rng.uniform(0.15, 0.55)
    for i in range(NX):
        for j in range(NY):
            u, v = (i + 0.5) / NX, (j + 0.5) / NY
            p = clamp(nz(u, v) * (1 - tilt) + u * tilt)
            r = rng.random()
            if r < heavy:
                ch = "█"
            elif r > 1 - light:
                ch = "▪"
            else:
                ch = pairs[0] if rng.random() < p else pairs[1]
            c.glyph(i, j, ch)
    return c
tenprint-glyph-32-1660
tenprint-glyph-32-1660
tenprint-glyph-32-c213
tenprint-glyph-32-c213
tenprint-glyph-32-d53e
tenprint-glyph-32-d53e
tenprint-glyph-32-6e6d
tenprint-glyph-32-6e6d
tenprint-glyph-32-bfd4
tenprint-glyph-32-bfd4
tenprint-glyph-32-ca25
tenprint-glyph-32-ca25
tenprint-glyph-32-b875
tenprint-glyph-32-b875
tenprint-glyph-32-bd20
tenprint-glyph-32-bd20
tenprint-glyph-32-fd08
tenprint-glyph-32-fd08
tenprint-glyph-32-cd16
tenprint-glyph-32-cd16
tenprint-glyph-32-4e4c
tenprint-glyph-32-4e4c
tenprint-glyph-32-f110
tenprint-glyph-32-f110
tenprint-glyph-32-da6d
tenprint-glyph-32-da6d

generator