Vous êtes sur la page 1sur 1

#Set number of digits to draw

$digits = 7

#Function to generate random numbers within the number array of 1 to 34 using get-
random commandlet

function random-num {

$random = get-random -input @(1..34) -count $digits


cls
$random | Sort-Object
}

random-num

#Option for player to play again


function play-again
{
$pa=read-host ("Here are your lucky numbers
Do you wish to play again? (y/n)")

if ($pa -eq "y")


{random-num}
else {Write-Host "Good luck" -foregroundcolor Yellow}
}
play-again
do {play-again} while ($pa = $true)

Vous aimerez peut-être aussi