Add login

This commit is contained in:
2020-01-05 23:20:38 +01:00
parent dc396a300f
commit c0926ffea0
35 changed files with 1647 additions and 39 deletions

View File

@@ -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) {