🎨 Make some nice Log
This commit is contained in:
parent
9c2d4c65fa
commit
4f2c6c4956
@ -15,6 +15,7 @@ func main() {
|
|||||||
defer file.Close()
|
defer file.Close()
|
||||||
|
|
||||||
completeFuel := 0
|
completeFuel := 0
|
||||||
|
recursiveFuel := 0
|
||||||
|
|
||||||
scanner := bufio.NewScanner(file)
|
scanner := bufio.NewScanner(file)
|
||||||
for scanner.Scan() {
|
for scanner.Scan() {
|
||||||
@ -25,14 +26,16 @@ func main() {
|
|||||||
log.Fatal(err)
|
log.Fatal(err)
|
||||||
}
|
}
|
||||||
|
|
||||||
completeFuel += CalcFuelRecusive(convert)
|
completeFuel += CalcRequiredFuel(convert)
|
||||||
|
recursiveFuel += CalcFuelRecusive(convert)
|
||||||
}
|
}
|
||||||
|
|
||||||
if err := scanner.Err(); err != nil {
|
if err := scanner.Err(); err != nil {
|
||||||
log.Fatal(err)
|
log.Fatal(err)
|
||||||
}
|
}
|
||||||
|
|
||||||
log.Println(completeFuel)
|
log.Println("Part1: " + strconv.Itoa(completeFuel))
|
||||||
|
log.Println("Part2: " + strconv.Itoa(recursiveFuel))
|
||||||
}
|
}
|
||||||
|
|
||||||
func CalcFuelRecusive(mass float64) int {
|
func CalcFuelRecusive(mass float64) int {
|
||||||
|
Loading…
Reference in New Issue
Block a user