Realm

gno.land/r/g12cs4cehujpffpjpywmkqj43m6u5ya53nj69sjz/piglatin

Rendered output

Pig Latin

A tiny on-chain port of the classic Pig Latin translator (the go-to beginner exercise). Pure strings/unicode, fully deterministic.

Rules

  1. Word starts with a vowel → append way. appleappleway
  2. Word starts with consonant(s) → move the leading consonant cluster to the end, then add ay. stringingstray
  3. y is a consonant only as the first letter (yellowellowyay); otherwise a vowel (mythythmay).
  4. Capitalization is preserved: HelloEllohay, NASAASANAY.
  5. Punctuation glued to a word stays put: Hello,Ellohay,.

Try it

Append a sentence to the path — spaces are fine:

  • [/hello world](/r/moul/x/daily/piglatin/v1:/hello world) → ellohay orldway
  • [/The quick brown fox](/r/moul/x/daily/piglatin/v1:/The quick brown fox) → Ethay uickqay ownbray oxfay
  • [/I love Gno!](/r/moul/x/daily/piglatin/v1:/I love Gno!) → Iway ovelay Ognay!

Examples

Input Pig Latin
pig igpay
banana ananabay
smile ilesmay
eat eatway
yellow ellowyay
myth ythmay
Hello, Ellohay,
GNO OGNAY

Query (read-only)

non-crossing functions · no tx, no wallet needed
Translate(sentence string) → string
TranslateToken(token string) → string

All exported functions (3)

show raw signatures
NameParamsReturns
TranslateToken [{"Name": "token", "Type": "string", "Value": ""}] [{"Name": ".res.0", "Type": "string", "Value": ""}]
Translate [{"Name": "sentence", "Type": "string", "Value": ""}] [{"Name": ".res.0", "Type": "string", "Value": ""}]
Render [{"Name": "path", "Type": "string", "Value": ""}] [{"Name": ".res.0", "Type": "string", "Value": ""}]

Files

Storage

{
  "raw": "storage: 7991, deposit: 799100"
}