A-M baby
This commit is contained in:
parent
764da6cbbb
commit
db842d013d
19005 changed files with 197040 additions and 7 deletions
22
Task/Loops-Nested/Groovy/loops-nested.groovy
Normal file
22
Task/Loops-Nested/Groovy/loops-nested.groovy
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
final random = new Random()
|
||||
def a = []
|
||||
(0..<10).each {
|
||||
def row = []
|
||||
(0..<10).each {
|
||||
row << (random.nextInt(20) + 1)
|
||||
}
|
||||
a << row
|
||||
}
|
||||
|
||||
a.each { println it }
|
||||
println ()
|
||||
|
||||
Outer:
|
||||
for (i in (0..<a.size())) {
|
||||
for (j in (0..<a[i].size())) {
|
||||
if (a[i][j] == 20){
|
||||
println ([i:i, j:j])
|
||||
break Outer
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue