leo/compiler/tests/statements/conditional/chain.leo

13 lines
203 B
Plaintext
Raw Normal View History

2020-06-13 13:39:51 +03:00
function main(bit: u32) -> u32 {
2020-07-17 22:59:18 +03:00
let mut result = 0u32;
2020-06-13 13:39:51 +03:00
2020-07-17 22:59:18 +03:00
if bit == 1 {
result = 1;
} else if bit == 2 {
result = 2;
} else {
result = 3;
}
2020-06-13 13:39:51 +03:00
2020-07-17 22:59:18 +03:00
return result
2020-06-13 13:39:51 +03:00
}