interplane.Get Omega
Read in your language

omega-mv

Omega: a language for verified programs, semantic identity and machine realization. Seed-born work and existing implementations have distinct provenance.

Brought by drakestapleton

branch main Branches Tags History

omega-mv / si / rosetta / exercises / eliuds-eggs / test.om

76 lines · 1638 bytes Raw Blame History
1note ---- test harness (appended after the solution by exercise.sh) ----
2text tok "ok "
3text tnok "not ok "
4text tsep " - "
5text tnl "\n"
6global tfails ulong 1
7global tnum ulong 1
8fn temit a view uchar * to void
9o = ulong 0
10while lt o len a bound 4096
11k = write 1 a o sub len a o
12if le k 0
13exit 2
14end
15o = add o ulong k
16end
17end
18fn temitu n ulong to void
19d = new uchar 20 0
20i = ulong 20
21v = n
22while true bound 20
23i = sub i 1
24put d i uchar add rem v 10 48
25v = div v 10
26if eq v 0
27break
28end
29end
30temit part d i sub 20 i
31end
32note one TAP-style line per case; main returns the number of failed cases
33fn tcheck c bool what view uchar * to void
34put tnum 0 add get tnum 0 1
35if c
36temit tok
37else
38temit tnok
39put tfails 0 add get tfails 0 1
40end
41temitu get tnum 0
42temit tsep
43temit what
44temit tnl
45end
46note cases: exercism/problem-specifications exercises/eliuds-eggs/canonical-data.json at
47note commit 650bebeb39ad40439175288042aece982b0a90a9 (2026-10-19), MIT licence,
48note https://github.com/exercism/problem-specifications
49note 4 cases kept, 0 skipped
50text c0 "eggCount: 0 eggs"
51text c1 "eggCount: 1 egg"
52text c2 "eggCount: 4 eggs"
53text c3 "eggCount: 13 eggs"
54note canonical case 559e789d-07d1-4422-9004-3b699f83bca3
55fn tc0 to bool
56ret eq eggcount 0 0
57end
58note canonical case 97223282-f71e-490c-92f0-b3ec9e275aba
59fn tc1 to bool
60ret eq eggcount 16 1
61end
62note canonical case 1f8fd18f-26e9-4144-9a0e-57cdfc4f4ff5
63fn tc2 to bool
64ret eq eggcount 89 4
65end
66note canonical case 0c18be92-a498-4ef2-bcbb-28ac4b06cb81
67fn tc3 to bool
68ret eq eggcount 2000000000 13
69end
70fn main to int
71tcheck tc0 c0
72tcheck tc1 c1
73tcheck tc2 c2
74tcheck tc3 c3
75ret int get tfails 0
76end