You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
BlidDev edited this page Jan 9, 2024
·
2 revisions
Overview:
It is possible to create both for style and while loops in Niv using these 2 methods:
// either create a normal while loopwhiletrue
{
// runs forever
}
set ans ""while [cal $ans ! "exit"]
{
set ans [input "Enter your input:> "]
}
// or create a for loop
set i 0while [cal $i < 10]
{
// runs 10 times
print "i - {}\n" $i
op i + 1
}
while
usage example:
// templatewhilestatement// specific usewhile [cal5>10]
Args:
statement: BOOL
Desc:
Loops the provided scope as long as statement is true. As with those in ifs, the curly brackets are sensitive to their placement in the code.