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.
47 lines
916 B
47 lines
916 B
5 years ago
|
package main
|
||
|
|
||
|
import (
|
||
|
"github.com/01-edu/z01"
|
||
|
|
||
5 years ago
|
correct "./correct"
|
||
5 years ago
|
student "./student"
|
||
5 years ago
|
)
|
||
|
|
||
5 years ago
|
func main() {
|
||
5 years ago
|
arr := [][]interface{}{
|
||
|
{
|
||
|
[]string{"coding", "algorithm", "ascii", "package", "golang"},
|
||
|
1,
|
||
|
},
|
||
|
{
|
||
|
[]string{"coding", "algorithm", "ascii", "package", "golang"},
|
||
|
-3,
|
||
|
},
|
||
|
{
|
||
|
[]string{"coding", "algorithm", "ascii", "package", "golang"},
|
||
|
2, 4,
|
||
|
},
|
||
|
{
|
||
|
[]string{"coding", "algorithm", "ascii", "package", "golang"},
|
||
|
-2, -1,
|
||
|
},
|
||
|
{
|
||
|
[]string{"coding", "algorithm", "ascii", "package", "golang"},
|
||
|
2, 0,
|
||
|
},
|
||
|
}
|
||
|
|
||
|
s := z01.MultRandWords()
|
||
|
|
||
|
arr = append(arr, []interface{}{s, -len(s) - 10, -len(s) - 5})
|
||
|
|
||
|
for i := 0; i < 3; i++ {
|
||
|
s = z01.MultRandWords()
|
||
|
arr = append(arr, []interface{}{s, z01.RandIntBetween(-len(s)-10, len(s)+10), z01.RandIntBetween(-len(s)-8, len(s)+10)})
|
||
|
}
|
||
|
|
||
|
for _, a := range arr {
|
||
5 years ago
|
z01.Challenge("Slice", student.Slice, correct.Slice, a...)
|
||
5 years ago
|
}
|
||
|
}
|