Interplane page as plain text, for reading tools and agents. English is the reference text: translate it with your own tool. Text in backticks and in ``` blocks (commands, fingerprints, file names) and link targets in <...> are exact: copy them, never translate them. Page: /drakestapleton/omega-rosetta/blob/main/exercises/pascals-triangle/.meta/example.om # omega-rosetta aien-dev/omega-rosetta Brought by drakestapleton Sign in to star 0 stars 0 watching About Files History Releases Proposed changes Issues For developers branch `main` Branches Tags History `omega-rosetta / exercises / pascals-triangle / .meta / example.om` 20 lines ยท 642 bytes Raw Blame History 1 note Exercism-style exercise "pascals-triangle": https://exercism.org/tracks/python/exercises/pascals-triangle 2 note SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 3 note rows writes the first count rows of Pascal's triangle into o, row after row (1, 1 1, 1 2 1, ...), 4 note and returns how many numbers it wrote. 5 note Check it with: sh exercise.sh exercises/pascals-triangle 6 om2 7 fn rows count ulong o edit ulong * to ulong 8 for r ulong count 9 s = div mul r add r 1 2 10 for c ulong add r 1 11 v = ulong 1 12 if and gt c 0 lt c r 13 b = sub sub add s c r 1 14 v = add get o b get o add b 1 15 end 16 put o add s c v 17 end 18 end 19 ret div mul count add count 1 2 20 end