|
@@ -5,6 +5,7 @@ import (
|
|
|
"fmt"
|
|
|
"log"
|
|
|
"os"
|
|
|
+ "sort"
|
|
|
"strings"
|
|
|
)
|
|
|
|
|
@@ -76,6 +77,14 @@ func plot(plan []Dig) []Point {
|
|
|
result = append(result, current.getPoints(plan[i])...)
|
|
|
}
|
|
|
|
|
|
+ sort.Slice(result, func(i, j int) bool {
|
|
|
+ if result[i].y == result[j].y {
|
|
|
+ return result[i].x < result[j].x
|
|
|
+ }
|
|
|
+
|
|
|
+ return result[i].y < result[j].y
|
|
|
+ })
|
|
|
+
|
|
|
return result
|
|
|
}
|
|
|
|