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.
38 lines
722 B
38 lines
722 B
5 years ago
|
package main
|
||
5 years ago
|
|
||
|
import (
|
||
|
"github.com/01-edu/z01"
|
||
|
|
||
|
solutions "./solutions"
|
||
|
student "./student"
|
||
|
)
|
||
|
|
||
5 years ago
|
func main() {
|
||
5 years ago
|
functionsArray := []func(int) bool{solutions.IsPositive, solutions.IsNegative0, solutions.IsPrime}
|
||
|
|
||
|
type node struct {
|
||
|
f func(int) bool
|
||
|
arr []int
|
||
|
}
|
||
|
|
||
|
table := []node{}
|
||
|
|
||
|
for i := 0; i < 15; i++ {
|
||
|
functionSelected := functionsArray[z01.RandIntBetween(0, len(functionsArray)-1)]
|
||
|
val := node{
|
||
|
f: functionSelected,
|
||
|
arr: z01.MultRandIntBetween(-1000000, 1000000),
|
||
|
}
|
||
|
table = append(table, val)
|
||
|
}
|
||
|
|
||
|
table = append(table, node{
|
||
|
f: solutions.IsPrime,
|
||
|
arr: []int{1, 2, 3, 4, 5, 6},
|
||
|
})
|
||
|
|
||
|
for _, arg := range table {
|
||
5 years ago
|
z01.Challenge("Map", student.Map, solutions.Map, arg.f, arg.arr)
|
||
5 years ago
|
}
|
||
|
}
|