1
0
Fork 0
mirror of synced 2025-09-23 12:18:44 +00:00
ZoKrates/examples/if_eq.code
2017-06-13 11:57:19 +02:00

7 lines
205 B
Text

// example using if-then-else-fi with ==
// x = 1 -> 1 + 1 + 1 = 3
// x = 2 -> 2 + 5 + 125 = 132
def main(x):
y = if x + 2 == 3 then 1 else 5 fi
z = if y == x then x**3 else y**3 fi
return x + y + z