summaryrefslogtreecommitdiff
path: root/p83/test.go
blob: 11c3249751def03616e7e4c3273b1d5d25666073 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
package main


import "fmt"
import "math/rand"
import "time"


func main() {
  rand.Seed(time.Now().Unix())

  v := PQueue{}

  n := rand.Int() % 5000 + 5000

  for i := 0  ; i < n ; i++ {
    if rand.Int()%10 == 2 && v.isEmpty() == false {
      fmt.Println("🦊");
      for j := 0 ; j < 10 && v.isEmpty() == false ; j++ {
        fmt.Println( v.pop() )
      }
      fmt.Println(v)
    } else {
      v.push( rand.Int() % 200 )
      fmt.Println
    }
  }

  v.push(10)
  fmt.Println(v)
  v.push(20)
  fmt.Println(v)
  v.push(11)
  fmt.Println(v)
  v.push(31)
  fmt.Println(v)
  v.pop()
  
  fmt.Println(v)
}