Conditions
if score > 10:
say("high")
elif score:
say("positive")
else:
say("zero")
For integers, zero is false and every other value is true. Empty strings and collections are false when converted with bool.
DATACRAFT V2
DataCraft lowers control flow into generated Minecraft functions and execute if commands.
if score > 10:
say("high")
elif score:
say("positive")
else:
say("zero")
For integers, zero is false and every other value is true. Empty strings and collections are false when converted with bool.
for item in items:
say(item)
A loop compiles into a helper function that recursively schedules its next iteration.
while remaining > 0:
remaining = remaining - 1
The condition is reevaluated before each recursive iteration.
break exits the nearest loop. continue skips to its next iteration. Returns propagate correctly through generated loop and branch helpers.