Files
game-of-life/math/pair.go
Natercio Moniz ea5b5c4e75 Initial commit
implemented the game of life variation with hexagonal grid
2025-12-16 11:33:00 +00:00

20 lines
319 B
Go

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)
}