Loops/Nested: Difference between revisions
Content added Content deleted
Alextretyak (talk | contribs) (Added 11l) |
(Updated to work with Nim 1.4. Changed the way to initialize the array. Done other syntactical changes.) |
||
Line 2,518:
=={{header|Nim}}==
<lang nim>import
const
var a: array[
var s
randomize() #
# Initialize using loops on items rather than indexes.
for item in row.mitems:
item = rand(1..20)
block outer:
# Loop using indexes.
for j in
if a[i][j] <
s.add(",
echo
{{out}}
<pre> 9, 16, 3, 18, 4, 17, 2, 16, 7, 6,
|