1package millipede23import (4 "strconv"5 "strings"67 "gno.land/p/nt/ufmt/v0"8)910const (11 minSize = 112 defaultSize = 2013 maxSize = 10014)1516func Draw(size int) string {17 if size < minSize || size > maxSize {18 panic("invalid millipede size")19 }20 paddings := []string{" ", " ", "", " ", " ", " ", " ", " ", " "}21 var b strings.Builder22 b.WriteString(" ╚⊙ ⊙╝\n")23 for i := 0; i < size; i++ {24 b.WriteString(paddings[i%9] + "╚═(███)═╝\n")25 }26 return b.String()27}2829func Render(path string) string {30 size := defaultSize3132 path = strings.TrimSpace(path)33 if path != "" {34 var err error35 size, err = strconv.Atoi(path)36 if err != nil {37 panic(err)38 }39 }4041 output := "```\n" + Draw(size) + "```\n"42 if size > minSize {43 output += ufmt.Sprintf("[%d](/r/demo/art/millipede:%d)< ", size-1, size-1)44 }45 if size < maxSize {46 output += ufmt.Sprintf(" >[%d](/r/demo/art/millipede:%d)", size+1, size+1)47 }48 return output49}5051// based on https://github.com/getmillipede/millipede-go/blob/977f046c39c35a650eac0fd30245e96b22c7803c/main.go52Draw(size int) string
Render(path string) string
Signatures reconstructed verbatim from vm/qfuncs — interface params keep their inline definitions.
vm/qrender output, sanitized (docs/render-security.md) and displayed in an empty-sandbox iframe — scripts, forms and popups cannot run. Links stay inert in-preview; right-click to open.