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
@ -4,10 +4,8 @@
|
||||
|
||||
module rand
|
||||
|
||||
import time
|
||||
|
||||
pub fn seed() {
|
||||
C.srand(time.now().uni)
|
||||
pub fn seed(s int) {
|
||||
C.srand(s)
|
||||
}
|
||||
|
||||
pub fn next(max int) int {
|
||||
@ -15,4 +13,3 @@ pub fn next(max int) int {
|
||||
}
|
||||
|
||||
fn C.rand() int
|
||||
|
||||
|
Reference in New Issue
Block a user