interplane.Get Omega
Read in your language

omega-rosetta

aien-dev/omega-rosetta

Brought by drakestapleton

branch main Branches Tags History

omega-rosetta / exercises / reverse-string / .meta / example.om

12 lines · 431 bytes Raw Blame History
1note Exercism-style exercise "reverse-string": https://exercism.org/tracks/python/exercises/reverse-string
2note SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
3note reverse writes the bytes of s into o in reverse order and returns the length.
4note Check it with: sh exercise.sh exercises/reverse-string
5om2
6fn reverse s view uchar * o edit uchar * to ulong
7n = len s
8for i ulong n
9put o i get s sub sub n 1 i
10end
11ret n
12end