mirror of
https://github.com/erg-lang/erg.git
synced 2025-09-28 20:14:45 +00:00
12 lines
240 B
Python
12 lines
240 B
Python
Binary = Patch {0, 1}
|
|
Binary.
|
|
invert self =
|
|
if self == 0, 1 else 0
|
|
assert 1.invert() == 0
|
|
assert 0.invert() == 1
|
|
|
|
Nat = Patch {I | I >= 0}
|
|
Nat.times! self, block! =
|
|
for! 0..<self, _ => block!()
|
|
10.times! do!:
|
|
print! "!"
|