$firstBet = 2 # money that you invest on the first bet $rowLimit = 10 # maximum length of row of same colour that you are able to stay $lastRnd = -1 $row = 1 [int64] $allRounds = 0 [int64] $earnings = 0 [int64] $minBalance = 0 $startTime = Get-Date while ($true) { $allRounds ++ $rnd = Get-Random 2 if (($rnd -eq $lastRnd) -and ($row -le $rowLimit)) { $row ++ } else { if ($row -le $rowLimit) { $earnings += $firstBet Write-Host ("Hod {0,10} :Vyhravate, celkem mate ted {1} a nejhure jste mel {2}" -f $allRounds, $earnings, $minBalance) } else { $earnings -= ($firstBet * [Math]::Pow(2,$row)) - $firstBet if ($earnings -lt $minBalance) { $minBalance = $earnings } Write-Host ("Hod {0,10} :Prohravate, celkem mate ted {1} a nejhure jste mel {2}" -f $allRounds, $earnings, $minBalance) } $row = 1 } $lastRnd = $rnd }