Skip to content

Commit

Permalink
refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
agiledragon committed Sep 5, 2018
1 parent 3791077 commit 013d0b7
Showing 1 changed file with 7 additions and 12 deletions.
19 changes: 7 additions & 12 deletions counting-shapes/domain/model/spec.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,19 +21,14 @@ func IsQuadrangle(points Points, lines []Line) bool {
b := points[1]
c := points[2]
d := points[3]
ab := Points([]Point{a, b})
cd := Points([]Point{c, d})
ad := Points([]Point{a, d})
bc := Points([]Point{b, c})

ring_order_connected_without_cross := func(w, x, y, z Point) bool {
wx := Points([]Point{w, x})
yz := Points([]Point{y, z})
wz := Points([]Point{w, z})
xy := Points([]Point{x, y})
return ring_order_connected(w, x, y, z) &&
not(cross_connected(wx, yz)) &&
not(cross_connected(wz, xy))

}

return ring_order_connected_without_cross(a, b, c, d) &&
return ring_order_connected(a, b, c, d) &&
not(cross_connected(ab, cd)) &&
not(cross_connected(ad, bc)) &&
not(in_same_line(a, b, c)) &&
not(in_same_line(a, b, d)) &&
not(in_same_line(a, c, d)) &&
Expand Down

0 comments on commit 013d0b7

Please sign in to comment.