gilo/internal/gilo/point.go
Timothy Warren cc99f08747
Some checks failed
timw4mail/gilo/pipeline/head There was a failure building this commit
Update to chapter 7 step 161 in kilo tutorial
2023-10-03 17:02:22 -04:00

24 lines
392 B
Go

// Package gilo Point struct
package gilo
// Point an x,y coordinate
type Point struct {
X int
Y int
}
// DefaultPoint creates a Point at 0,0
func DefaultPoint() *Point {
return &Point{0, 0}
}
// NewPoint creates a new Point
func NewPoint(x, y int) *Point {
return &Point{x, y}
}
// Clone create a new point from an old one
func (p *Point) Clone() *Point {
return &Point{p.X, p.Y}
}