Data update
This commit is contained in:
parent
5150844a7d
commit
4bb20c9b71
7735 changed files with 38060 additions and 199180 deletions
|
|
@ -1,24 +0,0 @@
|
|||
#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++
|
||||
$nReverse = Read-Host -Prompt "[$Array] -- How many digits to reverse? "
|
||||
[Array]::Reverse($Array,0,$nReverse)
|
||||
}
|
||||
"$Array"
|
||||
"Your score: $nTries"
|
||||
Loading…
Add table
Add a link
Reference in a new issue