Data update
This commit is contained in:
parent
4bb20c9b71
commit
cbaf4c4b64
12390 changed files with 318560 additions and 27248 deletions
19
Task/General-FizzBuzz/PowerShell/general-fizzbuzz.ps1
Normal file
19
Task/General-FizzBuzz/PowerShell/general-fizzbuzz.ps1
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
$limit = 20
|
||||
$data = @("3 Fizz","5 Buzz","7 Baxx")
|
||||
#An array with whitespace as the delimiter
|
||||
#Between the factor and the word
|
||||
|
||||
for ($i = 1;$i -le $limit;$i++){
|
||||
$outP = ""
|
||||
foreach ($x in $data){
|
||||
$data_split = $x -split " " #Split the "<factor> <word>"
|
||||
if (($i % $data_split[0]) -eq 0){
|
||||
$outP += $data_split[1] #Append the <word> to outP
|
||||
}
|
||||
}
|
||||
if(!$outP){ #Is outP equal to NUL?
|
||||
Write-HoSt $i
|
||||
} else {
|
||||
Write-HoSt $outP
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue