上传代码

This commit is contained in:
liwei1dao 2023-10-19 18:45:47 +08:00
parent daffb7d975
commit eb000d90b7

View File

@ -38,10 +38,11 @@ func RandomColor(difficulty pb.DBDColorDifficulty, Repeat bool) (temcolors []pb.
}
if Repeat {
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()]
}
} else {
colors = colors[0:colorNum]
for i := 0; i < colorNum; i++ {
n, _ := rand.Int(rand.Reader, big.NewInt(int64(len(colors))))
index := n.Int64()