interplane.Get Omega
Read in your language

omega-rosetta

aien-dev/omega-rosetta

Brought by drakestapleton

branch main Branches Tags History

omega-rosetta / exercises / grains / .meta / example.om

12 lines · 464 bytes Raw Blame History
1note Exercism-style exercise "grains": https://exercism.org/tracks/python/exercises/grains
2note SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
3note square n is the grains on square n (1 .. 64) of a chessboard when each square doubles the
4note last, starting from 1; total is the grains on the whole board.
5note Check it with: sh exercise.sh exercises/grains
6om2
7fn square n ulong to ulong
8ret shl ulong 1 sub n 1
9end
10fn total to ulong
11ret not ulong 0
12end