1 // Copyright 2018 The Go Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style
3 // license that can be found in the LICENSE file.
5 // Run the game of life in C using Go for parallelization.
17 var dim = flag.Int("dim", 16, "board dimensions")
18 var gen = flag.Int("gen", 10, "generations")
23 var a [MAXDIM * MAXDIM]int32
24 for i := 2; i < *dim; i += 8 {
25 for j := 2; j < *dim-3; j += 8 {
26 for y := 0; y < 3; y++ {
32 p, err := plugin.Open("life.so")
36 f, err := p.Lookup("Run")
40 f.(func(int, int, int, []int32))(*gen, *dim, *dim, a[:])
42 for i := 0; i < *dim; i++ {
43 for j := 0; j < *dim; j++ {