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
omega-mv / si / rosetta / exercises / allergies / allergies.om
| 1 | note Exercism-style exercise "allergies": https://exercism.org/tracks/python/exercises/allergies |
| 2 | note SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception |
| 3 | note The allergens in score order are eggs 1, peanuts 2, shellfish 4, strawberries 8, tomatoes 16, |
| 4 | note chocolate 32, pollen 64, cats 128; a score is the sum of the allergens (higher bits are ignored). |
| 5 | note allergicto is true when score includes item; list writes the allergens of score, in that order, |
| 6 | note joined by commas, into o and returns the number of bytes written. |
| 7 | note Check it with: sh exercise.sh exercises/allergies |
| 8 | om2 |
| 9 | fn allergicto item view uchar * score ulong to bool |
| 10 | note replace this line with your solution |
| 11 | trap 13 |
| 12 | end |
| 13 | fn list score ulong o edit uchar * to ulong |
| 14 | note replace this line with your solution |
| 15 | trap 13 |
| 16 | end |