Compare commits

..
4 Commits
Author SHA1 Message Date
Daniel Aberger cf1fe949f6 4th: add emojis 🥰 2021-12-06 10:24:27 +01:00
Daniel Aberger 44055b2260 3rd: add emojis 🥰 2021-12-06 10:24:19 +01:00
Daniel Aberger 7570da8191 2nd: add emojis 🥰 2021-12-06 10:24:09 +01:00
Daniel Aberger aba4b17e18 1st: add emojis 🥰 2021-12-06 10:23:59 +01:00
4 changed files with 8 additions and 8 deletions
+2 -2
View File
@@ -12,8 +12,8 @@ import (
func Run() { func Run() {
draws, boards := readInput() draws, boards := readInput()
fmt.Printf("1st winning board: %d\n", calculateWinningBoard(findFirstWinningBoard(boards, createPlayboards(boards), draws))) fmt.Printf("1st winning board 🥇: %d\n", calculateWinningBoard(findFirstWinningBoard(boards, createPlayboards(boards), draws)))
fmt.Printf("2nd winning board: %d\n", calculateWinningBoard(findLastWinningBoard(boards, createPlayboards(boards), draws))) fmt.Printf("2nd winning board 🥈: %d\n", calculateWinningBoard(findLastWinningBoard(boards, createPlayboards(boards), draws)))
} }
func calculateWinningBoard(board [][]int, playboard [][]bool, draw int) int { func calculateWinningBoard(board [][]int, playboard [][]bool, draw int) int {
+2 -2
View File
@@ -9,8 +9,8 @@ import (
) )
func Run() { func Run() {
fmt.Printf("1st solution: %d\n", solveFirst()) fmt.Printf("1st solution 🔊: %d\n", solveFirst())
fmt.Printf("2nd solution: %d\n", solveSecond()) fmt.Printf("2nd solution 🔊: %d\n", solveSecond())
} }
func readInput() []int { func readInput() []int {
+2 -2
View File
@@ -12,8 +12,8 @@ import (
func Run() { func Run() {
values := readInput() values := readInput()
heatmap := createHeatmap(values) heatmap := createHeatmap(values)
fmt.Printf("power: %d\n", calcPower(calcGamma(heatmap, len(values)), calcEpsilon(heatmap, len(values)))) fmt.Printf("power 🔋: %d\n", calcPower(calcGamma(heatmap, len(values)), calcEpsilon(heatmap, len(values))))
fmt.Printf("oxygen * co2 (life support): %d\n", calcOxygen(values)*calcCO2(values)) fmt.Printf("life support 🌱 (oxygen * co2): %d\n", calcOxygen(values)*calcCO2(values))
} }
func calcOxygen(values [][]int) int { func calcOxygen(values [][]int) int {
+2 -2
View File
@@ -11,8 +11,8 @@ import (
func Run() { func Run() {
commands := readInput() commands := readInput()
fmt.Printf("1st final position: %d\n", solve(commands, false)) fmt.Printf("1st final position 🛰️: %d\n", solve(commands, false))
fmt.Printf("2nd final position: %d\n", solve(commands, true)) fmt.Printf("2nd final position 🛰️: %d\n", solve(commands, true))
} }
func solve(commands []string, alt bool) int { func solve(commands []string, alt bool) int {