Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
24
Task/Loops-Nested/Nemerle/loops-nested.nemerle
Normal file
24
Task/Loops-Nested/Nemerle/loops-nested.nemerle
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
using System;
|
||||
using System.Console;
|
||||
using Nemerle.Imperative;
|
||||
|
||||
module NestedLoops
|
||||
{
|
||||
Main() : void
|
||||
{
|
||||
def arr = array(10, 10);
|
||||
def rnd = Random();
|
||||
|
||||
foreach ((i, j) in $[(i, j) | i in [0 .. 9], j in [0 .. 9]])
|
||||
arr[i, j] = rnd.Next(1, 21);
|
||||
|
||||
Finish:
|
||||
{
|
||||
foreach ((i, j) in $[(i, j) | i in [0 .. 9], j in [0 .. 9]])
|
||||
{
|
||||
Write("{0} ", arr[i, j]);
|
||||
when (arr[i, j] == 20) Finish();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue