Initial commit

implemented the game of life variation with hexagonal grid
This commit is contained in:
2025-12-16 11:33:00 +00:00
commit ea5b5c4e75
17 changed files with 1229 additions and 0 deletions

30
ticker.go Normal file
View File

@@ -0,0 +1,30 @@
package main
import (
"time"
)
type Ticker struct {
*time.Ticker
}
func NewTicker(rate int, interval time.Duration) *Ticker {
t := &Ticker{
Ticker: time.NewTicker(interval / time.Duration(rate)),
}
return t
}
func (t *Ticker) Reset(rate int, interval time.Duration) {
t.Ticker.Reset(interval / time.Duration(rate))
}
func (t *Ticker) HasTicked() bool {
select {
case <-t.C:
return true
default:
return false
}
}