You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
![]() |
2 months ago | |
---|---|---|
cmd/shapes | 2 months ago | |
.gitignore | 2 months ago | |
LICENSE | 2 months ago | |
README.md | 2 months ago | |
circle.go | 2 months ago | |
go.mod | 2 months ago | |
rectangle.go | 2 months ago | |
shape.go | 2 months ago |
README.md
shapes
This is an example Go package for implementing geometric shapes.
Quick Start
package main
import (
"fmt"
"git.mills.io/prologic/shapes"
)
var _ shapes.Shape = Triangle{}
type Triangle struct {
Sides []float64
}
// TODO: Implement me
func (t Triangle) Area() float64 { return 0.0 }
// TODO: Implement me
func (t Triangle) Perimeter() float64 { return 0.0 }
func main() {
t := Triangle{Sides: []float64{2, 2, 2}}
fmt.Println(t.Area())
}
License
shapes
is licensed under the terms of the MIT License.