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.
48 lines
889 B
48 lines
889 B
5 years ago
|
package main
|
||
|
|
||
5 years ago
|
import "../lib"
|
||
5 years ago
|
|
||
5 years ago
|
func main() {
|
||
5 years ago
|
type nodeTest struct {
|
||
|
dataSearched string
|
||
|
letterLookedFor string
|
||
|
letterReplacing string
|
||
|
}
|
||
|
|
||
|
table := []nodeTest{}
|
||
|
|
||
|
for i := 0; i < 20; i++ {
|
||
5 years ago
|
letter1 := []rune(lib.RandAlnum())
|
||
|
letter2 := []rune(lib.RandAlnum())
|
||
5 years ago
|
|
||
|
table = append(table,
|
||
|
nodeTest{
|
||
5 years ago
|
dataSearched: lib.RandWords(),
|
||
5 years ago
|
letterLookedFor: string(letter1[0]),
|
||
|
letterReplacing: string(letter2[0]),
|
||
|
})
|
||
|
}
|
||
|
|
||
|
table = append(table,
|
||
|
nodeTest{
|
||
|
dataSearched: "hélla",
|
||
|
letterLookedFor: "é",
|
||
|
letterReplacing: "o",
|
||
|
},
|
||
|
nodeTest{
|
||
|
dataSearched: "hella",
|
||
|
letterLookedFor: "z",
|
||
|
letterReplacing: "o",
|
||
|
},
|
||
|
nodeTest{
|
||
|
dataSearched: "hella",
|
||
|
letterLookedFor: "h",
|
||
|
letterReplacing: "o",
|
||
|
},
|
||
|
)
|
||
|
|
||
|
for _, arg := range table {
|
||
5 years ago
|
lib.ChallengeMain("searchreplace", arg.dataSearched, arg.letterLookedFor, arg.letterReplacing)
|
||
5 years ago
|
}
|
||
|
}
|