next time when you are stuck picking lotto numbers , here is some fun code for you
its just a random number picker nothing special and it wont make you win the lotto
just change the main code to suit your lotto
if you wont numbers between 1 to 45 change $number = 1..45
or if you like your numbers 1,22,33,44,55,66,77,11 change $number = 1,22,33,44,55,66,77,11
Enjoy
note: you can have 1,000,000 spins but it will take a day to run
this will be my last post for the lottery post for good please don't e-mail as my account will be delete soon , good bye all and good luck on wining the lotto :)
code :
#main code#############################
$number = 1..45
$numberstoplay = 6
$games = 3
$spin = 1..6107
####################################
$3 =$spin.Count
$greater = 1
$lineCount121 =0
$stopwatch = [system.diagnostics.stopwatch]::StartNew()
$spin | ForEach-Object {
cls
$lineCount121 += 1
$host.ui.RawUI.WindowTitle = "current spin :$lineCount121 total spin $3 "
($number| Get-Random -count $numberstoplay)-join(",")
}| ForEach-Object {($_.Split(",") | foreach {[int]$_ }| sort )-join(",") } | group-object | Where {$_.count -gt $greater} | sort-object -Property "Count" -Descending |Select-Object -First $games | ft -HideTableHeaders -auto -Property ("Name", "Count")
$stopwatch.Stop()
$totalTime = $StopWatch.Elapsed.TotalSeconds
$TT = New-TimeSpan -Seconds $totalTime
$totalTimeStr = "Time elapsed: " + $TT.Hours + " hours, " + $TT.minutes + " minutes, and " + $TT.seconds + " seconds."
write-host $totalTimeStr