Add login
This commit is contained in:
@@ -9,7 +9,8 @@ type Random interface {
|
||||
Int() int
|
||||
}
|
||||
|
||||
func init(){}
|
||||
func init() {}
|
||||
|
||||
type rndGenerator func(n int) int
|
||||
|
||||
type Randomizer struct {
|
||||
@@ -29,13 +30,14 @@ func Rand(rand int) int {
|
||||
}
|
||||
func realRand(n int) int { return int(rand.Intn(n)) }
|
||||
func fakeRand(n int) func(numb int) int {
|
||||
return func(numb int)int {
|
||||
return func(numb int) int {
|
||||
if n >= numb {
|
||||
panic(fmt.Sprintf("%d Should not be superior of %d",n,numb))
|
||||
panic(fmt.Sprintf("%d Should not be superior of %d", n, numb))
|
||||
}
|
||||
return n
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
var randGen = NewRandomizer(realRand).Int
|
||||
|
||||
func FakeRandomizer(n int) {
|
||||
|
||||
Reference in New Issue
Block a user