Loops/Break: Difference between revisions

Content added Content deleted
No edit summary
(GDScript)
Line 1,666: Line 1,666:
# 1 16
# 1 16
# 10</syntaxhighlight>
# 10</syntaxhighlight>

=={{header|GDScript}}==
{{works with|Godot|4.0.1}}
{{trans|11l}}

<syntaxhighlight lang="gdscript">
extends MainLoop


func _process(_delta: float) -> bool:
randomize()

while true:
var a: int = randi_range(0, 19)
print(a)
if a == 10:
break
var b: int = randi_range(0, 19)
print(b)

return true # Exit
</syntaxhighlight>


=={{header|GML}}==
=={{header|GML}}==