glox/tests/while.lox
2024-10-08 20:32:13 +03:00

35 lines
No EOL
527 B
Text

var iterator = 100;
{
while (iterator > 0) {
{
print iterator;
iterator = iterator - 2;
}
}
}
{
while (iterator < 100) {
{
{
print iterator;
iterator = iterator + 2;
if (iterator > 50) break;
print "shoud not be printed after 50";
}
print "OUTER also shoud not be printed after 50";
}
}
}
while (iterator < 100) iterator = iterator + 2;
print iterator;