9 lines
222 B
Text
9 lines
222 B
Text
// example using ternary operator with ==
|
|
// x = 1 -> 1 + 1 + 1 = 3
|
|
// x = 2 -> 2 + 5 + 125 = 132
|
|
def main(field x) -> field {
|
|
field y = x + 2 == 3 ? 1 : 5;
|
|
field z = y == x ? x**3 : y**3;
|
|
return x + y + z;
|
|
}
|
|
|