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 / scrabble-score / .meta / example.om

21 lines · 662 bytes Raw Blame History
1note Exercism-style exercise "scrabble-score": https://exercism.org/tracks/python/exercises/scrabble-score
2note SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
3note score is the Scrabble score of word, ignoring case: AEIOULNRST 1, DG 2, BCMP 3, FHVWY 4, K 5,
4note JX 8, QZ 10.
5note Check it with: sh exercise.sh exercises/scrabble-score
6om2
7note letter values A .. Z, each stored as 48 + value (":" is 10)
8text sv "1332142418513113:11114484:"
9fn score word view uchar * to ulong
10t = ulong 0
11for i ulong len word
12c = get word i
13if and ge c 97 le c 122
14c = sub c 32
15end
16if and ge c 65 le c 90
17t = add t ulong sub get sv ulong sub c 65 48
18end
19end
20ret t
21end