rhea/assets/examples/loops.rhea

18 lines
342 B
Plaintext
Raw Normal View History

2023-09-14 10:35:11 -05:00
func main(){
var i = 0;
2023-10-02 17:16:27 -05:00
// The only loop is `loop` and it does not do any form of count up and break
2023-09-14 10:35:11 -05:00
loop {
match i {
2023-10-02 17:16:27 -05:00
// break will break out of `one` loop
2023-09-14 10:35:11 -05:00
10 -> break;
}
2023-10-02 17:16:27 -05:00
// Increment by one
2023-09-14 10:35:11 -05:00
i = i + 1;
}
2023-10-02 17:16:27 -05:00
// This is functionally identical to a HCF
2023-09-14 10:35:11 -05:00
loop {}
}