1
0
Fork 0
mirror of https://github.com/Luzifer/aoc2019.git synced 2024-10-18 03:04:19 +00:00

Initialize module, remove external dep

Signed-off-by: Knut Ahlers <knut@ahlers.me>
This commit is contained in:
Knut Ahlers 2019-12-10 16:33:37 +01:00
parent c5e14ed7f4
commit 38c9de6a8a
Signed by: luzifer
GPG key ID: DC2729FDD34BE99E
3 changed files with 14 additions and 3 deletions

1
.gitignore vendored
View file

@ -1,2 +1,3 @@
/cover
day03_debug.png
go.sum

View file

@ -3,12 +3,13 @@ package aoc2019
import (
"image"
"image/color"
"image/png"
"io/ioutil"
"math"
"os"
"strconv"
"strings"
"github.com/llgcode/draw2d/draw2dimg"
"github.com/pkg/errors"
)
@ -145,9 +146,13 @@ func debugDay3DrawImage(l1, l2 day3Line) error {
// Draw "home-point" in green
dest.SetRGBA(0, 0, color.RGBA{0x0, 0xff, 0x0, 0xff})
draw2dimg.SaveToPngFile("day03_debug.png", dest)
f, err := os.Create("day03_debug.png")
if err != nil {
return errors.Wrap(err, "Unable to open output file")
}
defer f.Close()
return nil
return errors.Wrap(png.Encode(f, dest), "Unable to write image")
}
func getDay3MinIntersectionDistance(l1, l2 day3Line, originX, originY int) int {

5
go.mod Normal file
View file

@ -0,0 +1,5 @@
module github.com/Luzifer/aoc2019
go 1.13
require github.com/pkg/errors v0.8.1