mirror of https://github.com/01-edu/public.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
53 lines
971 B
53 lines
971 B
5 years ago
|
package main
|
||
|
|
||
|
import (
|
||
|
"github.com/01-edu/z01"
|
||
5 years ago
|
|
||
|
solutions "../../solutions"
|
||
5 years ago
|
)
|
||
|
|
||
|
type node struct {
|
||
|
big, little string
|
||
|
}
|
||
|
|
||
5 years ago
|
func main() {
|
||
5 years ago
|
table := []node{}
|
||
|
|
||
|
table = append(table,
|
||
|
node{"aaaaaaa", "a"},
|
||
|
node{"qwerty", "t"},
|
||
|
node{"a", "b"},
|
||
|
)
|
||
|
|
||
|
for i := 0; i < 10; i++ {
|
||
|
l := z01.RandIntBetween(5, 30)
|
||
|
big := z01.RandStr(l, "qwertyuiopasdfghjklzxcvbnm")
|
||
|
start := z01.RandIntBetween(0, l-1)
|
||
|
end := z01.RandIntBetween(start+1, l-1)
|
||
|
little := big[start:end]
|
||
|
|
||
|
value := node{
|
||
|
big: big,
|
||
|
little: little,
|
||
|
}
|
||
|
|
||
|
table = append(table, value)
|
||
|
}
|
||
|
|
||
|
for i := 0; i < 10; i++ {
|
||
|
big := z01.RandStr(z01.RandIntBetween(5, 30), "qwertyuiopasdfghjklzxcvbnm")
|
||
|
little := z01.RandStr(z01.RandIntBetween(1, 29), "qwertyuiopasdfghjklzxcvbnm")
|
||
|
|
||
|
value := node{
|
||
|
big: big,
|
||
|
little: little,
|
||
|
}
|
||
|
|
||
|
table = append(table, value)
|
||
|
}
|
||
|
|
||
|
for _, arg := range table {
|
||
5 years ago
|
z01.Challenge("DoppelGangerProg", DoppelGanger, solutions.DoppelGanger, arg.big, arg.little)
|
||
5 years ago
|
}
|
||
|
}
|