interplane.Get Omega
Read in your language

omega-rosetta

aien-dev/omega-rosetta

Brought by drakestapleton

branch main Branches Tags History

omega-rosetta / exercises / isogram / test.om

150 lines · 3919 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/isogram/canonical-data.json at
47note commit 650bebeb39ad40439175288042aece982b0a90a9 (2026-10-19), MIT licence,
48note https://github.com/exercism/problem-specifications
49note 14 cases kept, 0 skipped
50text z0 "z"
51text c1 "isIsogram: empty string"
52text s2 "isogram"
53text c3 "isIsogram: isogram with only lower case characters"
54text s4 "eleven"
55text c5 "isIsogram: word with one duplicated character"
56text s6 "zzyzx"
57text c7 "isIsogram: word with one duplicated character from the end of the alphabet"
58text s8 "subdermatoglyphic"
59text c9 "isIsogram: longest reported english isogram"
60text s10 "Alphabet"
61text c11 "isIsogram: word with duplicated character in mixed case"
62text s12 "alphAbet"
63text c13 "isIsogram: word with duplicated character in mixed case, lowercase first"
64text s14 "thumbscrew-japingly"
65text c15 "isIsogram: hypothetical isogrammic word with hyphen"
66text s16 "thumbscrew-jappingly"
67text c17 "isIsogram: hypothetical word with duplicated character following hyphen"
68text s18 "six-year-old"
69text c19 "isIsogram: isogram with duplicated hyphen"
70text s20 "Emily Jung Schwartzkopf"
71text c21 "isIsogram: made-up name that is an isogram"
72text s22 "accentor"
73text c23 "isIsogram: duplicated character in the middle"
74text s24 "angola"
75text c25 "isIsogram: same first and last characters"
76text s26 "up-to-date"
77text c27 "isIsogram: word with duplicated character and with two hyphens"
78note canonical case a0e97d2d-669e-47c7-8134-518a1e2c4555
79fn tc0 to bool
80ret eq isisogram part z0 0 0 true
81end
82note canonical case 9a001b50-f194-4143-bc29-2af5ec1ef652
83fn tc1 to bool
84ret eq isisogram s2 true
85end
86note canonical case 8ddb0ca3-276e-4f8b-89da-d95d5bae78a4
87fn tc2 to bool
88ret eq isisogram s4 false
89end
90note canonical case 6450b333-cbc2-4b24-a723-0b459b34fe18
91fn tc3 to bool
92ret eq isisogram s6 false
93end
94note canonical case a15ff557-dd04-4764-99e7-02cc1a385863
95fn tc4 to bool
96ret eq isisogram s8 true
97end
98note canonical case f1a7f6c7-a42f-4915-91d7-35b2ea11c92e
99fn tc5 to bool
100ret eq isisogram s10 false
101end
102note canonical case 14a4f3c1-3b47-4695-b645-53d328298942
103fn tc6 to bool
104ret eq isisogram s12 false
105end
106note canonical case 423b850c-7090-4a8a-b057-97f1cadd7c42
107fn tc7 to bool
108ret eq isisogram s14 true
109end
110note canonical case 93dbeaa0-3c5a-45c2-8b25-428b8eacd4f2
111fn tc8 to bool
112ret eq isisogram s16 false
113end
114note canonical case 36b30e5c-173f-49c6-a515-93a3e825553f
115fn tc9 to bool
116ret eq isisogram s18 true
117end
118note canonical case cdabafa0-c9f4-4c1f-b142-689c6ee17d93
119fn tc10 to bool
120ret eq isisogram s20 true
121end
122note canonical case 5fc61048-d74e-48fd-bc34-abfc21552d4d
123fn tc11 to bool
124ret eq isisogram s22 false
125end
126note canonical case 310ac53d-8932-47bc-bbb4-b2b94f25a83e
127fn tc12 to bool
128ret eq isisogram s24 false
129end
130note canonical case 0d0b8644-0a1e-4a31-a432-2b3ee270d847
131fn tc13 to bool
132ret eq isisogram s26 false
133end
134fn main to int
135tcheck tc0 c1
136tcheck tc1 c3
137tcheck tc2 c5
138tcheck tc3 c7
139tcheck tc4 c9
140tcheck tc5 c11
141tcheck tc6 c13
142tcheck tc7 c15
143tcheck tc8 c17
144tcheck tc9 c19
145tcheck tc10 c21
146tcheck tc11 c23
147tcheck tc12 c25
148tcheck tc13 c27
149ret int get tfails 0
150end