上传代码
This commit is contained in:
parent
daffb7d975
commit
eb000d90b7
@ -38,10 +38,11 @@ func RandomColor(difficulty pb.DBDColorDifficulty, Repeat bool) (temcolors []pb.
|
|||||||
}
|
}
|
||||||
if Repeat {
|
if Repeat {
|
||||||
for i := 0; i < colorNum; i++ {
|
for i := 0; i < colorNum; i++ {
|
||||||
n, _ := rand.Int(rand.Reader, big.NewInt(8))
|
n, _ := rand.Int(rand.Reader, big.NewInt(int64(colorNum)))
|
||||||
temcolors[i] = colors[n.Int64()]
|
temcolors[i] = colors[n.Int64()]
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
colors = colors[0:colorNum]
|
||||||
for i := 0; i < colorNum; i++ {
|
for i := 0; i < colorNum; i++ {
|
||||||
n, _ := rand.Int(rand.Reader, big.NewInt(int64(len(colors))))
|
n, _ := rand.Int(rand.Reader, big.NewInt(int64(len(colors))))
|
||||||
index := n.Int64()
|
index := n.Int64()
|
||||||
|
Loading…
Reference in New Issue
Block a user