Transaction

C52C243005DEDF…1BAF70AFFE8B

Block 26,336 · index 0 · indexed

Summary

Hash
C52C243005DEDF7701E1C1CAA7D4EFC76E903C2619FC515F1EBD1BAF70AFFE8B
Block
26,336
Size
3490 bytes
Gas used
8,479,960 / 10,176,012
Fee
1000000ugnot
Memo
gnopublish
Status
success

Messages

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

Arguments · 9

  1. #1gnoface
  2. #2README.md
  3. #3# `gno.land/r/moul/demo/gnoface/v0` Generates a random ASCII/SVG "gno face" — a small generative-art demo realm. Uses [`p/moul/entropy`](../../../../../p/moul/entropy/v0) for pseudo-randomness. 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/gnoface/v0 dependency graph](https://raw.githubusercontent.com/moul/gno-contracts/main/_assets/gno.land/r/moul/demo/gnoface/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. #4gnoface.gno
  5. #5package gnoface import ( "math/rand" "strconv" "strings" "gno.land/p/moul/entropy/v0" "gno.land/p/nt/ufmt/v0" ) func Render(path string) string { seed := uint64(entropy.New().Value()) path = strings.TrimSpace(path) if path != "" { s, err := strconv.Atoi(path) if err != nil { panic(err) } seed = uint64(s) } output := ufmt.Sprintf("Gnoface #%d\n", seed) output += "```\n" + Draw(seed) + "```\n" return output } func Draw(seed uint64) string { var ( hairs = []string{ " s", " .......", " s s s", " /\\ /\\", " |||||||", } headtop = []string{ " /-------\\", " /~~~~~~~\\", " /|||||||\\", " ////////\\", " |||||||||", " /\\\\\\\\\\\\\\\\", } headspace = []string{ " | |", } eyebrow = []string{ "~", "*", "_", ".", } ear = []string{ "o", " ", "D", "O", "<", ">", ".", "|", ")", "(", } eyesmiddle = []string{ "| o o |", "| o _ |", "| _ o |", "| . . |", "| O O |", "| v v |", "| X X |", "| x X |", "| X D |", "| ~ ~ |", } nose = []string{ " | o |", " | O |", " | V |", " | L |", " | C |", " | ~ |", " | . . |", " | . |", } mouth = []string{ " | __/ |", " | \\_/ |", " | . |", " | ___ |", " | ~~~ |", " | === |", " | <=> |", } headbottom = []string{ " \\-------/", " \\~~~~~~~/", " \\_______/", } ) r := rand.New(rand.NewPCG(seed, 0xdeadbeef)) return pick(r, hairs) + "\n" + pick(r, headtop) + "\n" + pick(r, headspace) + "\n" + " | " + pick(r, eyebrow) + " " + pick(r, eyebrow) + " |\n" + pick(r, ear) + pick(r, eyesmiddle) + pick(r, ear) + "\n" + pick(r, headspace) + "\n" + pick(r, nose) + "\n" + pick(r, headspace) + "\n" + pick(r, mouth) + "\n" + pick(r, headspace) + "\n" + pick(r, headbottom) + "\n" } func pick(r *rand.Rand, slice []string) string { return slice[r.IntN(len(slice))] } // based on https://github.com/moul/pipotron/blob/master/dict/ascii-face.yml
  6. #6gnomod.toml
  7. #7module = "gno.land/r/moul/demo/gnoface/v0" gno = "0.9"
  8. #8/gno.MemPackageType
  9. #9 MPUserProd

Result log

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

← Back to block 26,336