1
0
Fork 0
mirror of synced 2025-09-23 12:18:44 +00:00
ZoKrates/zokrates_cli/examples/simple_conditional.zok
2022-04-06 20:23:58 +02:00

8 lines
203 B
Text

// simple ifelse example
// x = 2 -> 2 + 1 + 2**3 = 11
// x = 5 -> 5 + 5 + 5**3 = 135
def main(field x) -> field {
field y = x < 3 ? 1 : 5;
field z = y < x ? x**3 : y**3:
return x + y + z;
}