Data commit

This commit is contained in:
Ingy döt Net 2023-07-01 11:58:00 -04:00
parent 7387c8f97b
commit cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions

View file

@ -0,0 +1,24 @@
#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"