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.
28 lines
570 B
28 lines
570 B
5 years ago
|
package main
|
||
5 years ago
|
|
||
|
import (
|
||
5 years ago
|
"github.com/01-edu/z01"
|
||
|
|
||
5 years ago
|
correct "./correct"
|
||
5 years ago
|
student "./student"
|
||
|
)
|
||
|
|
||
5 years ago
|
func main() {
|
||
5 years ago
|
seps := []string{" ", "-", " ,", "_", "SPC", " . "}
|
||
|
|
||
5 years ago
|
args := [][]string{
|
||
|
{"hello", "how", "are", "you", "doing"},
|
||
|
{"fine", "and", "you"},
|
||
|
{"I'm", "O.K."},
|
||
|
}
|
||
5 years ago
|
|
||
|
for i := 0; i < 5; i++ {
|
||
5 years ago
|
// random position for the slice of arguments
|
||
5 years ago
|
posA := z01.RandIntBetween(0, len(args)-1)
|
||
5 years ago
|
// random position for the slice of separators
|
||
5 years ago
|
posS := z01.RandIntBetween(0, len(seps)-1)
|
||
|
|
||
5 years ago
|
z01.Challenge("Join", student.Join, correct.Join, args[posA], seps[posS])
|
||
5 years ago
|
}
|
||
|
}
|