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/drafts/rosettacode/leap-year.wiki # 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 / drafts / rosettacode / leap-year.wiki` 71 lines ยท 1251 bytes Raw Blame History 1 =={{header|Omegese}}== 2 {{works with|omc|sha256 `2c824805`, aien-dev/omega-mv `e5b32567`, Linux AArch64}} 3 Omega has no imports, so the small output helpers (emit and friends) are part of the program. 4 5 om2 6 text yes " is a leap year\n" 7 text no " is not a leap year\n" 8 note emit writes every byte of a to stdout; a short write is retried, an error exits 1 9 fn emit a view uchar * to void 10 o = ulong 0 11 while lt o len a bound 4096 12 k = write 1 a o sub len a o 13 if le k 0 14 exit 1 15 end 16 o = add o ulong k 17 end 18 end 19 note emitu writes n in decimal; 20 digits hold every ulong 20 fn emitu n ulong to void 21 d = new uchar 20 0 22 i = ulong 20 23 v = n 24 while true bound 20 25 i = sub i 1 26 put d i uchar add rem v 10 48 27 v = div v 10 28 if eq v 0 29 break 30 end 31 end 32 emit part d i sub 20 i 33 end 34 fn leap y ulong to bool 35 if eq rem y 400 0 36 ret true 37 end 38 if eq rem y 100 0 39 ret false 40 end 41 ret eq rem y 4 0 42 end 43 fn show y ulong to void 44 emitu y 45 if leap y 46 emit yes 47 else 48 emit no 49 end 50 end 51 fn main to int 52 show 1900 53 show 1996 54 show 2000 55 show 2023 56 show 2024 57 show 2100 58 show 2400 59 ret 0 60 end 61 62 {{out}} 63

64 1900 is not a leap year

65 1996 is a leap year

66 2000 is a leap year

67 2023 is not a leap year

68 2024 is a leap year

69 2100 is not a leap year

70 2400 is a leap year

71