mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
rand: change rand.seed() to receive seed value
This commit is contained in:
committed by
Alexander Medvednikov
parent
af7d49103b
commit
2cb12b4f4e
@@ -140,7 +140,7 @@ fn main() {
|
||||
}
|
||||
|
||||
fn (g mut Game) init_game() {
|
||||
rand.seed()
|
||||
rand.seed(time.now().uni)
|
||||
g.generate_tetro()
|
||||
g.field = []array_int // TODO: g.field = [][]int
|
||||
// Generate the field, fill it with 0's, add -1's on each edge
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import rand
|
||||
import time
|
||||
import os
|
||||
|
||||
const (HelpText = ' Usage:\t./VCasino\n
|
||||
@@ -87,7 +88,7 @@ fn get_bet(money int) int {
|
||||
}
|
||||
|
||||
fn run_wheel(bet_nbr int, bet int) int {
|
||||
rand.seed()
|
||||
rand.seed(time.now().uni)
|
||||
winning_nbr := rand.next(50)
|
||||
print('Roulette Wheel spinning... and stops on the number $winning_nbr which is a ')
|
||||
if winning_nbr % 2 == 1 {
|
||||
|
||||
Reference in New Issue
Block a user