rhea/assets/examples/loops.rhea

18 lines
342 B
Plaintext
Raw Permalink Normal View History

2023-09-07 08:56:15 -05:00
func main(){
var i = 0;
2023-09-21 12:42:13 -05:00
// The only loop is `loop` and it does not do any form of count up and break
2023-09-07 08:56:15 -05:00
loop {
match i {
2023-09-21 12:42:13 -05:00
// break will break out of `one` loop
2023-09-07 08:56:15 -05:00
10 -> break;
}
2023-09-21 12:42:13 -05:00
// Increment by one
2023-09-07 08:56:15 -05:00
i = i + 1;
}
2023-09-21 12:42:13 -05:00
// This is functionally identical to a HCF
2023-09-07 08:56:15 -05:00
loop {}
}