Search Apps Documentation Source Content File Folder Download Copy Actions Download State String Boolean Number Struct Map Slice Pointer Function Closure Reference Nil Package Type Interface Unknown

v0 source realm

Package asciiart is a small on-chain ASCII art generator. Instead of a hand-authored font table, each pattern is prod...

Readme View source

ASCII Art Generator

⚠️ Experimental — generated with no human supervision by the daily MCP pipeline to exercise gno tooling. Not audited. See r/moul/x/daily.


An on-chain ASCII art generator that draws patterns (diamond, pyramid, Sierpinski triangle, checkerboard) from short deterministic formulas instead of a hand-authored font table -- the Sierpinski gasket is just row & col == 0. Call Generate(pattern, size) to render a piece and add it to a public gallery; browse the gallery or a specific piece via Render. It's a neat, self-contained example of generative art as pure on-chain logic.

Built for sapphire (gno 0.9). Live demo (agent address): https://sapphire.testnets.gno.land/r/g12cs4cehujpffpjpywmkqj43m6u5ya53nj69sjz/asciiart


Part of moul/gno-contracts — moul's versioned gno.land contracts. See the repository for the full catalog, build/test tooling, and usage.

Dependency graph:

gno.land/r/moul/x/daily/asciiart/v0 dependency graph

🧪 Highly experimental — potentially vibe-coded. Not audited; may break, change, or be removed at any time. Do not use with anything of value. Full disclaimer: DISCLAIMER.

Overview

Package asciiart is a small on-chain ASCII art generator. Instead of a hand-authored font table, each pattern is produced by a short, pure, deterministic algorithm -- e.g. the Sierpinski triangle falls out of a single bitwise AND over row/column indices. Callers pick a pattern and a size; the realm renders it and keeps a gallery of everyone's generations.

Functions 6

func Generate

crossing Action
1func Generate(cur realm, pattern string, size int) string
source

Generate renders a pattern, adds it to the on-chain gallery, and returns the rendered art.

func Render

1func Render(path string) string
source

Render shows the pattern guide + gallery at "", or one piece by numeric ID.

func RenderDiamond

Action
1func RenderDiamond(n int) string
source

RenderDiamond draws a filled diamond of half-width n (2n-1 rows total), each row's stars centered and padded with spaces.

func RenderPyramid

Action
1func RenderPyramid(n int) string
source

RenderPyramid draws a solid triangle n rows tall, widening by two stars per row and centered with leading spaces.

func RenderSierpinski

Action
1func RenderSierpinski(n int) string
source

RenderSierpinski draws a Sierpinski triangle in an n x n grid (n must be a power of two): cell (row, col) is filled exactly when row&col == 0, the classic bitwise identity for Pascal's-triangle-mod-2.

Imports 5

Source Files 3