Fixed a lot of bugs with when expressions, also got deepseek to fix some of them
Added If expressions, which allow using if statements inside other expressions, for example, here is some previously invalid code that is now valid:
int max = if (a > b) a else b;
str message = if (score >= 90) {
looks::say("something");
"You win!"
} else {
looks::say("something");
"You lose :("
}
triangles[15] = Triangle(
utils::random(-240, 240),
utils::random(-180, 180),
utils::random(-240, 240),
utils::random(-180, 180),
utils::random(-240, 240),
if(mode == TriangleRenderMode.OFF) {
5
} else {
triangles[14].y3
}
);
These still get lowered properly and just look like normal if statements in the final scratch code
Comments 0
No comments yet. Be the first!
Sign in to join the conversation.