Transaction

CDFF928D2CD766…166A83D07D98

Block 26,341 · index 0 · indexed

Summary

Hash
CDFF928D2CD76665A4A8D6FAB2E664743B82BEDBBEC10B4827CC166A83D07D98
Block
26,341
Size
2396 bytes
Gas used
7,161,672 / 8,594,066
Fee
1000000ugnot
Memo
gnopublish
Status
success

Messages

#1AddPackagegno.land/r/moul/demo/millipede/v09 arguments

Arguments · 9

  1. #1millipede
  2. #2README.md
  3. #3# `gno.land/r/moul/demo/millipede/v0` Renders an ASCII millipede of a requested size — a tiny generative-art demo realm. Educational / fun example (see [r/moul/demo](../../README.md)). <!-- BEGIN GNOCONTRACTS FOOTER (generated by `make readmes`; do not edit below) --> --- Part of **[moul/gno-contracts](https://github.com/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/demo/millipede/v0 dependency graph](https://raw.githubusercontent.com/moul/gno-contracts/main/_assets/gno.land/r/moul/demo/millipede/v0/deps.png) > ⚠️ **Disclaimer:** provided as-is, without warranty; not security-audited. Full disclaimer: [DISCLAIMER](https://github.com/moul/gno-contracts/blob/main/DISCLAIMER.md). <!-- END GNOCONTRACTS FOOTER -->
  4. #4gnomod.toml
  5. #5module = "gno.land/r/moul/demo/millipede/v0" gno = "0.9"
  6. #6millipede.gno
  7. #7package millipede import ( "strconv" "strings" "gno.land/p/nt/ufmt/v0" ) const ( minSize = 1 defaultSize = 20 maxSize = 100 ) func Draw(size int) string { if size < minSize || size > maxSize { panic("invalid millipede size") } paddings := []string{" ", " ", "", " ", " ", " ", " ", " ", " "} var b strings.Builder b.WriteString(" ╚⊙ ⊙╝\n") for i := 0; i < size; i++ { b.WriteString(paddings[i%9] + "╚═(███)═╝\n") } return b.String() } func Render(path string) string { size := defaultSize path = strings.TrimSpace(path) if path != "" { var err error size, err = strconv.Atoi(path) if err != nil { panic(err) } } output := "```\n" + Draw(size) + "```\n" if size > minSize { output += ufmt.Sprintf("[%d](/r/demo/art/millipede:%d)< ", size-1, size-1) } if size < maxSize { output += ufmt.Sprintf(" >[%d](/r/demo/art/millipede:%d)", size+1, size+1) } return output } // based on https://github.com/getmillipede/millipede-go/blob/977f046c39c35a650eac0fd30245e96b22c7803c/main.go
  8. #8/gno.MemPackageType
  9. #9 MPUserProd

Result log

msg:0,success:true,log:,events:[]

← Back to block 26,341