mirror of
https://github.com/vlang/v.git
synced 2025-09-13 14:32:26 +03:00
rand: reorganize: phase 2
This commit is contained in:
parent
67fcce2d46
commit
e649cf84e3
28 changed files with 603 additions and 408 deletions
|
@ -7,11 +7,10 @@ const (
|
|||
)
|
||||
|
||||
fn main() {
|
||||
rand.seed(int(time.now().unix))
|
||||
rand.next(gen_max) // skip the first
|
||||
rand.intn(gen_max) // skip the first
|
||||
mut arr := []int{}
|
||||
for _ in 0..gen_len {
|
||||
arr << rand.next(gen_max)
|
||||
arr << rand.intn(gen_max)
|
||||
}
|
||||
println('length of random array is $arr.len')
|
||||
println('before quick sort whether array is sorted: ${is_sorted(arr)}')
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue