1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

rand: reorganize: phase 2

This commit is contained in:
Hungry Blue Dev
2020-06-09 18:36:07 +05:30
committed by GitHub
parent 67fcce2d46
commit e649cf84e3
28 changed files with 603 additions and 408 deletions

View File

@@ -81,7 +81,7 @@ fn get_bet(money int) int {
}
bet = line.int()
if bet <= 0 {
println('error: $line is not heigher than 1.')
println('error: $line is not higher than 1.')
continue
} else if bet > money {
println('error: $line is more money than you have.')
@@ -92,8 +92,7 @@ fn get_bet(money int) int {
fn run_wheel(bet_nbr int, _bet int) int {
mut bet := _bet
rand.seed(int(time.now().unix))
winning_nbr := rand.next(50)
winning_nbr := rand.intn(50)
print('Roulette Wheel spinning... and stops on the number $winning_nbr which is a ')
if winning_nbr % 2 == 1 {
println(odd)
@@ -115,7 +114,7 @@ fn run_wheel(bet_nbr int, _bet int) int {
fn is_broke(money int) bool {
if money <= 0 {
println('You\'broke, the game is over..')
println('You\'re broke, the game is over..')
return false
} else {
quit := Options{'yes', 'y'}