PathrockNetwork Gno Explorer
HomeBlocksTransactionsTokensRealmsPackagesValidatorsAnalytics

PathrockNetwork Gno Explorer — an independent explorer for Gno.land Mainnet (gnoland-1), operated by PathrockNetwork. Not an official Gno.land service.

gnowebarchive RPC

gno.land/r/moul/x/daily/markovdemo/v0

Realm
Open in gnoweb ↗

Overview

Kind
Realm (renderable)
Name
v0
Namespace
moul / x / daily / markovdemo
Files
3 (README)(gnomod.toml)
Exported functions
4
Module
gno.land/r/moul/x/daily/markovdemo/v0
gno
0.9

Files (3)

  • README.mdmarkdown
  • gnomod.tomltoml
  • markovdemo.gnogno

Select a file to view its exact on-chain source. Sorted README → gnomod → sources → tests.

Functions

  • Feed(cur interface {.seal func(); Address func() .uverse.address; IsCode func() bool; IsCurrent func() bool; IsEphemeral func() bool; IsUser func() bool; IsUserCall func() bool; IsUserRun func() bool; PkgPath func() string; Previous func() .uverse.realm; String func() string; Sub func(string) .uverse.realm; Subpath func() string}, text string) string

  • Generate(nWords int) string

  • Render(path string) string

  • Stats() (int, int)

Signatures reconstructed verbatim from vm/qfuncs — interface params keep their inline definitions.

Rendered

RenderedRawgnoweb ↗
# Markov Babbler

A demo of the [`p/moul/x/daily/markov`](/p/moul/x/daily/markov/v0) library — an on-chain port of Go's classic *"Generating arbitrary text: a Markov chain algorithm"* codewalk. Every two-word **prefix** maps to the words that followed it; `Generate` walks that chain, picking suffixes with a PRNG seeded by the block height — deterministic, yet different each block.

## Fresh sample (40 words, height 1406127)

> it was the age of wisdom it was the worst of times it was the age of foolishness i am the captain of my soul

## Corpus

- **Words:** 48
- **Distinct prefixes:** 33
- **Prefix length:** 2 words

## Some prefixes → suffixes

| prefix | can be followed by |
|---|---|
| `_(start)_` | it |
| ` it` | was |
| `a free` | man |
| `a number` | i |
| `age of` | wisdom, foolishness |
| `am a` | free |
| `am not` | a |
| `am the` | master, captain |
| `best of` | times |
| `captain of` | my |
| `fate i` | am |
| `foolishness i` | am |

_Call `Feed("your text here")` to teach it new words, then reload for a new sample._

vm/qrender output, sanitized (docs/render-security.md) and displayed in an empty-sandbox iframe — scripts, forms and popups cannot run. Links stay inert in-preview; right-click to open.