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.
54 lines
1.1 KiB
54 lines
1.1 KiB
5 years ago
|
package main
|
||
|
|
||
|
import (
|
||
|
"github.com/01-edu/z01"
|
||
|
)
|
||
|
|
||
|
type node struct {
|
||
|
operations []string
|
||
|
}
|
||
|
|
||
5 years ago
|
func main() {
|
||
5 years ago
|
table := []node{}
|
||
|
|
||
|
table = append(table,
|
||
|
node{
|
||
|
[]string{
|
||
|
"? love",
|
||
|
"? is",
|
||
|
"A loveis",
|
||
|
"? love",
|
||
|
"? Who",
|
||
|
"A Whoareyou",
|
||
|
"? is",
|
||
|
},
|
||
|
},
|
||
|
)
|
||
|
|
||
5 years ago
|
sets := [][]string{
|
||
5 years ago
|
[]string{"An", "array", "variable", "denotes", "the", "entire", "array"},
|
||
|
[]string{"This", "means", "that", "when", "you", "assign", "or", "pass"},
|
||
|
[]string{"To", "avoid", "the", "copy", "you", "could", "pass"},
|
||
|
[]string{"struct", "but", "with", "indexed", "rather", "than", "named", "fields"},
|
||
|
}
|
||
5 years ago
|
ops := []string{
|
||
5 years ago
|
"?", "x", "A",
|
||
|
}
|
||
|
|
||
|
for i := 0; i < 6; i++ {
|
||
|
result := []string{}
|
||
|
nOps := z01.RandIntBetween(3, 15)
|
||
|
index := z01.RandIntBetween(0, len(sets)-1)
|
||
|
for j := 0; j < nOps; j++ {
|
||
|
k := z01.RandIntBetween(0, len(ops)-1)
|
||
|
s := z01.RandIntBetween(0, len(sets[index])-1)
|
||
5 years ago
|
result = append(result, ops[k]+" "+sets[index][s])
|
||
5 years ago
|
}
|
||
|
table = append(table, node{result})
|
||
|
}
|
||
|
|
||
5 years ago
|
for _, arg := range table {
|
||
5 years ago
|
z01.ChallengeMain(arg.operations...)
|
||
5 years ago
|
}
|
||
|
}
|