1
0
Fork 0
mirror of synced 2025-09-23 12:18:44 +00:00
ZoKrates/zokrates_cli/examples/book/if_else_expensive.zok
2021-05-17 22:58:24 +02:00

12 lines
No EOL
242 B
Text

def cheap(field x) -> field:
return x + 1
def expensive(field x) -> field:
return x**1000
def main(field x) -> field:
return if x == 1 then\
cheap(x)\// executed
else\
expensive(x)\// also executed
fi