Search Apps Documentation Source Content File Folder Download Copy Actions Download State String Boolean Number Struct Map Slice Pointer Function Closure Reference Nil Package Type Interface Unknown

cowsay source realm

Package cowsay is an on-chain Gno port of the classic \`cowsay\` program: it prints an ASCII cow with a speech bubble...

Overview

Package cowsay is an on-chain Gno port of the classic `cowsay` program: it prints an ASCII cow with a speech bubble containing a message.

Original: cowsay by Tony Monroe (1999), a Perl program later ported to Go many times. This realm reimplements the core rendering — bubble framing, word-wrapping and the cow art — as pure, deterministic string logic.

Functions 2

func Render

1func Render(path string) string
source

Render displays the cow for gnoweb.

Example
1Render("")            -> default message ("Moo!")
2Render("/hello there") -> renders "hello there", word-wrapped

func Say

Action
1func Say(msg string) string
source

Say returns the full cowsay art (speech bubble + cow) for msg. An empty msg falls back to the default message.

Imports 1

  • strings stdlib

Source Files 2