Message-ID: <1280968749.791140.1386641397482.JavaMail.email@example.com> Subject: Exported From Confluence MIME-Version: 1.0 Content-Type: multipart/related; boundary="----=_Part_791139_983418523.1386641397482" ------=_Part_791139_983418523.1386641397482 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Content-Location: file:///C:/exported.html
for loop in Boo is not like the
for loop in =
languages like C and C#. It is more similar to a
The most common usage for a
for loop is in conjuction with =
range function creates an enumerator which yields numbe=
join function in this case, will create a string=
from an enumerator.
0 1 2 3 4 3 4 5 6 0 2 4 6 8=20
range can be called 3 ways:
range(start, end, step)
To be used in a
for loop is quite easy.
0 1 2 3 4=20
while loop is very similar to an
ent, except that it will repeat itself as long as its condition is true.
0 1 2 3 4=20
In case you didn't guess,
i +=3D 1 adds
1 to <=
continue keyword is used when looping. It will cause th=
e position of the code to return to the start of the loop (as long as the c=
ondition still holds).
1 3 5 7 9=20
This skips the
i is even, causing only the odds to be printed out.
i % 2=
actually takes the remainder of
i / 2, and checks it a=
unless loop is ve=
ry similar to other languages do-while statement.
10 9 8 7 6 5=20
Normally, this would be a simple while loop.
This is a good method= of doing things if you want to accomplish something at least once or have = the loop set itself up.
pass keyword is useful if you don't want to accomplish =
anything when defining a code block.
Go on to Part 05 - Containers and Casting