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.
36 lines
685 B
36 lines
685 B
package main |
|
|
|
import ( |
|
"github.com/01-edu/z01" |
|
|
|
solution "./solutions" |
|
student "./student" |
|
) |
|
|
|
// the structs from the other packages |
|
// struct just for the first exercise |
|
type NodeF = student.Node |
|
type NodeFS = solution.Node |
|
|
|
// simple struct, just insert a element in the struct |
|
func main() { |
|
n1 := &NodeFS{} |
|
n2 := &NodeF{} |
|
|
|
table := [][]int{{{132423}}} |
|
|
|
for i := 0; i < 5; i++ { |
|
table = append(table, z01.MultRandIntBetween(-1000000, 10000000)) |
|
} |
|
|
|
for _, items := range table { |
|
for _, item := range items { |
|
solution.CreateElem(n1, item) |
|
student.CreateElem(n2, item) |
|
} |
|
|
|
if n1.Data != n2.Data { |
|
z01.Fatalf("CreateElem == %d instead of %d\n", n1, n2) |
|
} |
|
} |
|
}
|
|
|