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

19
math/pair.go Normal file
View File

@@ -0,0 +1,19 @@
package math
import "fmt"
type Pair[T SignedNumber] struct {
X, Y T
}
func NewPair[T SignedNumber](x, y T) Pair[T] {
return Pair[T]{X: x, Y: y}
}
func (p Pair[T]) Equal(other Pair[T]) bool {
return p.X == other.X && p.Y == other.Y
}
func (c Pair[T]) String() string {
return fmt.Sprintf("(%v,%v)", c.X, c.Y)
}