diff --git a/solutions/go/darts/1/darts.go b/solutions/go/darts/1/darts.go new file mode 100644 index 0000000..fa94adb --- /dev/null +++ b/solutions/go/darts/1/darts.go @@ -0,0 +1,17 @@ +package darts +import "math" + +func Score(x, y float64) int { + z:= math.Sqrt(x*x + y*y) + + if z > 10 { + return 0 + } + if z > 5 { + return 1 + } + if z > 1 { + return 5 + } + return 10 +}