Transaction

0AC508539031E8…0FA0776F4A42

Block 26,378 · index 0 · indexed

Summary

Hash
0AC508539031E817421A55111C5074DB4FB6EC3DE0336E349C5B0FA0776F4A42
Block
26,378
Size
4530 bytes
Gas used
9,443,080 / 11,331,756
Fee
1000000 ugnot
Memo
gnopublish
Status
success

Messages

Arguments · 9

  1. #1piglatindemo
  2. #2README.md
  3. #3# `gno.land/r/moul/x/daily/piglatindemo/v0` Interactive gnoweb **demo of the [`p/moul/x/daily/piglatin`](https://github.com/moul/gno-contracts/tree/main/p/moul/x/daily/piglatin/v0) Pig Latin library** — it renders the rules, a gallery of worked examples, and a live sentence translator. It has no translation logic of its own. Append a sentence to the path to translate it, e.g. [`/r/moul/x/daily/piglatindemo/v0:/The quick brown fox`](https://gno.land/r/moul/x/daily/piglatindemo/v0:/The%20quick%20brown%20fox). <!-- 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/x/daily/piglatindemo/v0 dependency graph](https://raw.githubusercontent.com/moul/gno-contracts/main/_assets/gno.land/r/moul/x/daily/piglatindemo/v0/deps.png) > 🧪 **Highly experimental — potentially vibe-coded.** Not audited; may break, change, or be removed at any time. Do not use with anything of value. 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/x/daily/piglatindemo/v0" gno = "0.9"
  6. #6piglatindemo.gno
  7. #7// Package piglatindemo is a small gnoweb demo of the Pig Latin translator // provided by the [p/moul/x/daily/piglatin](/p/moul/x/daily/piglatin/v0) // library: it renders the rules, a gallery of worked examples, and an // interactive sentence translator. // // It contains no translation logic of its own — everything comes from // `piglatin.Translate` and `piglatin.TranslateToken`. package piglatindemo import ( "strings" "gno.land/p/moul/x/daily/piglatin/v0" ) // Render is the gnoweb entrypoint (Markdown). Root explains the rules; any // other path is treated as a sentence to translate, e.g. Render("/Hello world"). func Render(path string) string { var b strings.Builder sentence := strings.TrimPrefix(path, "/") sentence = strings.TrimSpace(sentence) if sentence == "" { b.WriteString("# Pig Latin\n\n") b.WriteString("Demo of the [`p/moul/x/daily/piglatin`](/p/moul/x/daily/piglatin/v0) ") b.WriteString("library — a tiny port of the classic **Pig Latin** translator ") b.WriteString("(the go-to beginner exercise). Pure `strings`/`unicode`, fully deterministic.\n\n") b.WriteString("## Rules\n\n") b.WriteString("1. Word starts with a **vowel** → append `way`. `apple` → `appleway`\n") b.WriteString("2. Word starts with **consonant(s)** → move the leading consonant cluster to the end, then add `ay`. `string` → `ingstray`\n") b.WriteString("3. `y` is a consonant only as the first letter (`yellow` → `ellowyay`); otherwise a vowel (`myth` → `ythmay`).\n") b.WriteString("4. **Capitalization** is preserved: `Hello` → `Ellohay`, `NASA` → `ASANAY`.\n") b.WriteString("5. **Punctuation** glued to a word stays put: `Hello,` → `Ellohay,`.\n\n") b.WriteString("## Try it\n\n") b.WriteString("Append a sentence to the path — spaces are fine:\n\n") for _, ex := range []string{"hello world", "The quick brown fox", "I love Gno!"} { b.WriteString("- [`/") b.WriteString(ex) b.WriteString("`](/r/moul/x/daily/piglatindemo/v0:/") b.WriteString(ex) b.WriteString(") → `") b.WriteString(piglatin.Translate(ex)) b.WriteString("`\n") } b.WriteString("\n## Examples\n\n") b.WriteString("| Input | Pig Latin |\n|---|---|\n") for _, w := range []string{"pig", "banana", "smile", "eat", "yellow", "myth", "Hello,", "GNO"} { b.WriteString("| `") b.WriteString(w) b.WriteString("` | `") b.WriteString(piglatin.TranslateToken(w)) b.WriteString("` |\n") } return b.String() } b.WriteString("# Pig Latin\n\n") b.WriteString("**Original:**\n\n> ") b.WriteString(sentence) b.WriteString("\n\n**Pig Latin:**\n\n> ") b.WriteString(piglatin.Translate(sentence)) b.WriteString("\n\n---\n\n[← rules & examples](/r/moul/x/daily/piglatindemo/v0)\n") return b.String() }
  8. #8/gno.MemPackageType
  9. #9 MPUserProd

Result log

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