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

render_example_test.gno

1.28 Kb · 33 lines
 1package romannumdemo
 2
 3// ExampleRender pins the realm's Render output as a gno testable example.
 4func ExampleRender() {
 5	print(Render(""))
 6	// Output:
 7	// # Roman numeral converter
 8	//
 9	// A tiny demo of the [`p/moul/x/daily/romannum`](/p/moul/x/daily/romannum/v0) library — the classic `ToRoman` / `FromRoman` kata. Pure and deterministic.
10	//
11	// ## Examples
12	//
13	// | decimal | roman |
14	// |---:|:---|
15	// | [1](/r/moul/x/daily/romannumdemo/v0:1) | I |
16	// | [4](/r/moul/x/daily/romannumdemo/v0:4) | IV |
17	// | [9](/r/moul/x/daily/romannumdemo/v0:9) | IX |
18	// | [14](/r/moul/x/daily/romannumdemo/v0:14) | XIV |
19	// | [40](/r/moul/x/daily/romannumdemo/v0:40) | XL |
20	// | [49](/r/moul/x/daily/romannumdemo/v0:49) | XLIX |
21	// | [90](/r/moul/x/daily/romannumdemo/v0:90) | XC |
22	// | [400](/r/moul/x/daily/romannumdemo/v0:400) | CD |
23	// | [900](/r/moul/x/daily/romannumdemo/v0:900) | CM |
24	// | [1994](/r/moul/x/daily/romannumdemo/v0:1994) | MCMXCIV |
25	// | [2024](/r/moul/x/daily/romannumdemo/v0:2024) | MMXXIV |
26	// | [3888](/r/moul/x/daily/romannumdemo/v0:3888) | MMMDCCCLXXXVIII |
27	// | [3999](/r/moul/x/daily/romannumdemo/v0:3999) | MMMCMXCIX |
28	//
29	// ## Try it
30	//
31	// - `:/<n>` — integer → Roman, e.g. `:/2024` → MMXXIV
32	// - `:/r/<roman>` — Roman → integer, e.g. `:/r/MMXXIV` → 2024
33}