Transaction
01594FBB394C0F…DA3ECA826B7A
Block 26,348 · index 0 · indexed
Summary
- Hash
- 01594FBB394C0F39E87BA3B7B1F6F38B8780BC1D364A40A51354DA3ECA826B7A
- Block
- 26,348
- Size
- 1969 bytes
- Gas used
- 6,852,643 / 8,223,231
- Fee
- 1000000ugnot
- Memo
- gnopublish
- Status
- success
Messages
- Package
- gno.land/r/moul/sapin/v0
Arguments · 11
- #1sapin
- #2README.md
- #3# `gno.land/r/moul/sapin/v0` ASCII Christmas-tree (« sapin ») renderer — `Sapin(size int) string` draws the tree; `Render(path)` serves it through gnoweb. Pure rendering, no state. <!-- 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. > ⚠️ **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 -->
- #4gnomod.toml
- #5module = "gno.land/r/moul/sapin/v0" gno = "0.9"
- #6render.gno
- #7package sapin import "strconv" const defaultSize int = 3 func Render(path string) string { size := defaultSize if path != "" { var err error size, err = strconv.Atoi(path) if err != nil { panic(err) } } sapin := Sapin(size) output := "```\n" + sapin + "```\n" return output }
- #8sapin.gno
- #9package sapin import "strings" func Sapin(size int) string { if size < 1 { return "" } var b strings.Builder for floor := 0; floor < size; floor++ { for j := 0; j < floor+4; j++ { spaces := size*2 - (floor-1)*2 - j + size - 2 bodies := j*2 + 1 + floor*4 b.WriteString(strings.Repeat(" ", spaces)) b.WriteString(strings.Repeat("*", bodies)) b.WriteString("\n") } } for i := 0; i < size; i++ { spaces := (size-1)*3 + 2 b.WriteString(strings.Repeat(" ", spaces)) b.WriteString("|||\n") } return b.String() }
- #10/gno.MemPackageType
- #11 MPUserProd
Result log
msg:0,success:true,log:,events:[]