package algorithm

import (
	"math/rand"
	"time"
)

// Shuffle var n int64
// var a int64= 1<<62
// 洗牌
func (c *Cards) Shuffle() {
	*c = make([]byte, TOTAL)
	copy(*c, CARDS)
	source := rand.NewSource(time.Now().UnixNano())
	//n ++
	//n %=a
	r := rand.New(source)
	for i := TOTAL - 1; i > 0; i-- {
		index := r.Int() % i
		(*c)[i], (*c)[index] = (*c)[index], (*c)[i]
	}

}
