fyne-io / life Goto Github PK
View Code? Open in Web Editor NEWFyne game of life simulation
License: Other
Fyne game of life simulation
License: Other
I'm getting this error when trying to build the app with fyne get
on MacOS (Intel, Monterey):
$ fyne get github.com/fyne-io/life
go: downloading fyne.io/fyne/v2 v2.0.0
go: downloading github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200625191551-73d3c3675aa3
go: downloading github.com/go-gl/gl v0.0.0-20190320180904-bf2b1f2f34d7
go: downloading golang.org/x/net v0.0.0-20200324143707-d3edc9973b7e
go: downloading golang.org/x/sys v0.0.0-20200720211630-cb9d2d5c5666
go: downloading golang.org/x/text v0.3.2
# golang.org/x/sys/unix
../../../../pkg/mod/golang.org/x/[email protected]/unix/syscall_darwin.1_13.go:29:3: //go:linkname must refer to declared function or variable
../../../../pkg/mod/golang.org/x/[email protected]/unix/zsyscall_darwin_amd64.1_13.go:27:3: //go:linkname must refer to declared function or variable
../../../../pkg/mod/golang.org/x/[email protected]/unix/zsyscall_darwin_amd64.1_13.go:40:3: //go:linkname must refer to declared function or variable
../../../../pkg/mod/golang.org/x/[email protected]/unix/zsyscall_darwin_amd64.go:28:3: //go:linkname must refer to declared function or variable
../../../../pkg/mod/golang.org/x/[email protected]/unix/zsyscall_darwin_amd64.go:43:3: //go:linkname must refer to declared function or variable
../../../../pkg/mod/golang.org/x/[email protected]/unix/zsyscall_darwin_amd64.go:59:3: //go:linkname must refer to declared function or variable
../../../../pkg/mod/golang.org/x/[email protected]/unix/zsyscall_darwin_amd64.go:75:3: //go:linkname must refer to declared function or variable
../../../../pkg/mod/golang.org/x/[email protected]/unix/zsyscall_darwin_amd64.go:90:3: //go:linkname must refer to declared function or variable
../../../../pkg/mod/golang.org/x/[email protected]/unix/zsyscall_darwin_amd64.go:105:3: //go:linkname must refer to declared function or variable
../../../../pkg/mod/golang.org/x/[email protected]/unix/zsyscall_darwin_amd64.go:121:3: //go:linkname must refer to declared function or variable
../../../../pkg/mod/golang.org/x/[email protected]/unix/zsyscall_darwin_amd64.go:121:3: too many errors
Error building application: exit status 2
Seems like an outdated dependency.
I m sorry i m not lawyer, if I want copy this repository, I have to "only" copy your licence or add somethings?
I sugest these changes:
type board struct {
cells [][]bool
nextGenCells [][]bool
generation int
width, height int
}
func (b *board) nextGen() {
b.computeNextGen()
b.generation++
b.nextGenCells, b.cells = b.cells, b.nextGenCells
}
func (b *board) computeNextGen() {
for y := 0; y < b.height; y++ {
for x := 0; x < b.width; x++ {
n := b.countNeighbours(x, y)
if b.cells[y][x] {
b.nextGenCells[y][x] = n == 2 || n == 3
} else {
b.nextGenCells[y][x] = n == 3
}
}
}
}
func (b *board) computeNextGen() {
for y := 0; y < b.height; y++ {
for x := 0; x < b.width; x++ {
go func(x,y int) {
n := b.countNeighbours(x, y)
if b.cells[y][x] {
b.nextGenCells[y][x] = n == 2 || n == 3
} else {
b.nextGenCells[y][x] = n == 3
}
b.ch<-true
}(x,y)
}
}
for y := 0; y < b.height; y++ {
for x := 0; x < b.width; x++ {
<-b.ch
}
}
}
func (g *game) buildUI() fyne.CanvasObject {
var pause *widget.Button
pause = widget.NewButton("Pause", func() {
g.paused = !g.paused
if g.paused {
pause.SetText("Resume")
} else {
pause.SetText("Pause")
}
})
title := container.New(layout.NewGridLayout(2), g.genText, pause)
return container.New(layout.NewBorderLayout(title, nil, nil, nil), title, g)
}
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.