September Morn Update
This commit is contained in:
parent
4e2d22a71d
commit
aac6731f2c
6856 changed files with 141342 additions and 21127 deletions
|
|
@ -1,4 +1,19 @@
|
|||
$Array = 1..9 | Get-Random -Count 9
|
||||
#adding the below function to the previous users submission to prevent the small
|
||||
#chance of getting an array that is in ascending order.
|
||||
|
||||
#Full disclosure: I am an infrastructure engineer, not a dev. My code is likely
|
||||
#bad.
|
||||
|
||||
function generateArray{
|
||||
$fArray = 1..9 | Get-Random -Count 9
|
||||
if (-join $fArray -eq -join @(1..9)){
|
||||
generateArray
|
||||
}
|
||||
return $fArray
|
||||
}
|
||||
$array = generateArray
|
||||
|
||||
#everything below is untouched from original submission
|
||||
$nTries = 0
|
||||
While(-join $Array -ne -join @(1..9)){
|
||||
$nTries++
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue