1
0
Fork 0
mirror of synced 2025-09-23 12:18:44 +00:00
ZoKrates/examples/simple_ifelse.code
Jacob Eberhardt f7b197791f Code samples adapted so they have a main function
Code samples now reflect the changes made to the absy by adding functions.
2017-06-13 17:39:20 +02:00

7 lines
188 B
Text

// simple ifelse example
// x = 2 -> 2 + 1 + 2**3 = 11
// x = 5 -> 5 + 5 + 5**3 = 135
def main(x):
y = if x < 3 then 1 else 5 fi
z = if y < x then x**3 else y**3 fi
return x + y + z