Skip to content Search Apps Documentation Source Content Run Reset Eval Playground File Folder Download Copy Actions State String Boolean Number Struct Map Slice Pointer Function Closure Reference Nil Package Type Interface Unknown

pixelcanvas/v0 package

Overview

Package pixelcanvas is a shared 16x16 pixel canvas: anyone can paint one cell at a time from a fixed 9-colour palette, and the canvas renders in gnoweb as a grid of coloured blocks.

The canvas is a flat [Size*Size]int of palette indices held in realm state — a fixed-size array rather than a tree, because every cell exists from the start and the grid is walked in full on every render. Painting is last-write-wins; the realm keeps who painted each cell and a per-address tally, so the board doubles as a contribution leaderboard.

A stateful app with nothing reusable to extract, so it ships as a lone realm rather than a p/ library + demo pair.

Function

PainterAt

func PainterAt(x, y int) string
Ask AI Claude ChatGPT

PainterAt returns the address that last painted (x, y), or "" if untouched.

Params

Command

gnokey query vm/qeval -remote "https://rpc.gno.land" -data "gno.land/r/moul/x/daily/pixelcanvas/v0.PainterAt(,)"

Result

Gno Expression Evaluator

Evaluate any read-only Gno expression against gno.land/r/moul/x/daily/pixelcanvas/v0, for example a function call with arguments.