diff --git a/README.md b/README.md index 1afed09..4fc07b6 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,22 @@ -# ddd-sample-in-golang +# DDD sample -ddd sample + +### cargo + +DDD sample with OO + +## counting shapes + +DDD sample with FP + +![](shapes.png) + +### counting triangles +How many triangles can you see? +24, details as follows: +[abc abd abe acd ace ade aef aeg aeh afg afh agh ahi ahj ahk aij aik ajk beh ceg def ehk fhj ghi] + +### counting quadrangles +How many quadrangles can you see? +18, details as follows: +[aceh adeg adeh afhk aghj aghk bcgh bcih bdfh bdjh bekh cdfg cdji ceki dekj efjk egik fgij] diff --git a/counting-shapes/domain/service/counting_shapes.go b/counting-shapes/domain/service/counting_shapes.go index 7184c3f..f223dde 100644 --- a/counting-shapes/domain/service/counting_shapes.go +++ b/counting-shapes/domain/service/counting_shapes.go @@ -3,6 +3,7 @@ package service import ( "github.com/agiledragon/ddd-sample-in-golang/counting-shapes/domain/model" // "fmt" + "fmt" ) func CountingTriangles(points model.Points, lines []model.Line) []model.Points { @@ -13,7 +14,7 @@ func CountingTriangles(points model.Points, lines []model.Line) []model.Points { matches = append(matches, set) } } - //fmt.Println("matches:", matches) + fmt.Println("matches:", matches) return matches } diff --git a/shapes.png b/shapes.png new file mode 100644 index 0000000..79b742e Binary files /dev/null and b/shapes.png differ