2016 Update
This commit is contained in:
parent
948b86eafa
commit
dcf5d15da3
7965 changed files with 139854 additions and 31002 deletions
|
|
@ -1 +1,4 @@
|
|||
Loop through and print each element in a collection in order. Use your language's "for each" loop if it has one, otherwise iterate through the collection in order with some other loop.
|
||||
Loop through and print each element in a collection in order.
|
||||
|
||||
Use your language's "for each" loop if it has one, otherwise iterate through the collection in order with some other loop.
|
||||
<br><br>
|
||||
|
|
|
|||
10
Task/Loops-Foreach/Elena/loops-foreach.elena
Normal file
10
Task/Loops-Foreach/Elena/loops-foreach.elena
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
#import system.
|
||||
#import system'routines.
|
||||
#import extensions'routines.
|
||||
|
||||
#symbol program =
|
||||
[
|
||||
#var things := ("Apple", "Banana", "Coconut").
|
||||
|
||||
things run &each:printingLn.
|
||||
].
|
||||
|
|
@ -1,3 +1,7 @@
|
|||
foreach ($x in $collection) {
|
||||
Write-Host $x
|
||||
$colors = "Black","Blue","Cyan","Gray","Green","Magenta","Red","White","Yellow",
|
||||
"DarkBlue","DarkCyan","DarkGray","DarkGreen","DarkMagenta","DarkRed","DarkYellow"
|
||||
|
||||
foreach ($color in $colors)
|
||||
{
|
||||
Write-Host "$color" -ForegroundColor $color
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue