This commit is contained in:
Karl Spickermann 2020-12-11 18:46:19 +01:00
parent 92ab7fae32
commit 954538b7bf
7 changed files with 320 additions and 23 deletions

@ -11,11 +11,13 @@
</component>
<component name="ChangeListManager">
<list default="true" id="400bdf61-8921-41d3-8f98-a0a1b0877f46" name="Default Changelist" comment="">
<change afterPath="$PROJECT_DIR$/day9/day9.go" afterDir="false" />
<change afterPath="$PROJECT_DIR$/day9/day9Test.txt" afterDir="false" />
<change afterPath="$PROJECT_DIR$/day11/day11.go" afterDir="false" />
<change afterPath="$PROJECT_DIR$/day11/day11Test.txt" afterDir="false" />
<change afterPath="$PROJECT_DIR$/day11/day11Test2.txt" afterDir="false" />
<change afterPath="$PROJECT_DIR$/day11/day11Test3.txt" afterDir="false" />
<change afterPath="$PROJECT_DIR$/day11/everythingOccupied.txt" afterDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/day1/day1.go" beforeDir="false" afterPath="$PROJECT_DIR$/day1/day1.go" afterDir="false" />
<change beforePath="$PROJECT_DIR$/helper/readFile.go" beforeDir="false" afterPath="$PROJECT_DIR$/helper/helper.go" afterDir="false" />
<change beforePath="$PROJECT_DIR$/helper/helper.go" beforeDir="false" afterPath="$PROJECT_DIR$/helper/helper.go" afterDir="false" />
</list>
<option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" />
@ -56,7 +58,27 @@
<recent name="C:\Users\karls\go\src\AoC2020" />
</key>
</component>
<component name="RunManager" selected="Go Build.go build day9.go">
<component name="RunManager" selected="Go Build.go build day11.go">
<configuration name="go build day10.go" type="GoApplicationRunConfiguration" factoryName="Go Application" nameIsGenerated="true">
<module name="AoC2020" />
<working_directory value="$PROJECT_DIR$/day10" />
<parameters value="day10Input.txt" />
<kind value="FILE" />
<filePath value="$PROJECT_DIR$/day10/day10.go" />
<package value="AoC2020" />
<directory value="$PROJECT_DIR$" />
<method v="2" />
</configuration>
<configuration name="go build day11.go" type="GoApplicationRunConfiguration" factoryName="Go Application" nameIsGenerated="true">
<module name="AoC2020" />
<working_directory value="$PROJECT_DIR$/day11" />
<parameters value="day11Input.txt" />
<kind value="FILE" />
<filePath value="$PROJECT_DIR$/day11/day11.go" />
<package value="AoC2020" />
<directory value="$PROJECT_DIR$" />
<method v="2" />
</configuration>
<configuration name="go build day1.go" type="GoApplicationRunConfiguration" factoryName="Go Application" nameIsGenerated="true">
<module name="AoC2020" />
<working_directory value="$PROJECT_DIR$/day1" />
@ -170,6 +192,8 @@
<item itemvalue="Go Build.go build day6.go" />
<item itemvalue="Go Build.go build day8.go" />
<item itemvalue="Go Build.go build day9.go" />
<item itemvalue="Go Build.go build day10.go" />
<item itemvalue="Go Build.go build day11.go" />
</list>
<recent_temporary>
<list>
@ -194,11 +218,11 @@
<option name="oldMeFiltersMigrated" value="true" />
</component>
<component name="WindowStateProjectService">
<state x="351" y="0" width="1092" height="955" key="#com.intellij.execution.impl.EditConfigurationsDialog" timestamp="1607534020287">
<state x="351" y="0" width="1092" height="1003" key="#com.intellij.execution.impl.EditConfigurationsDialog" timestamp="1607708739295">
<screen x="0" y="0" width="1920" height="1040" />
</state>
<state x="-1472" y="103" key="#com.intellij.execution.impl.EditConfigurationsDialog/-1920.0.1920.1040/0.0.1920.1040@-1920.0.1920.1040" timestamp="1607019292652" />
<state x="351" y="0" width="1092" height="955" key="#com.intellij.execution.impl.EditConfigurationsDialog/-1920.0.1920.1040/0.0.1920.1040@0.0.1920.1040" timestamp="1607534020287" />
<state x="351" y="0" width="1092" height="1003" key="#com.intellij.execution.impl.EditConfigurationsDialog/-1920.0.1920.1040/0.0.1920.1040@0.0.1920.1040" timestamp="1607708739295" />
<state x="661" y="322" key="#com.intellij.fileTypes.FileTypeChooser" timestamp="1606836882379">
<screen x="0" y="0" width="1920" height="1040" />
</state>
@ -207,26 +231,26 @@
<screen x="0" y="0" width="1920" height="1040" />
</state>
<state x="739" y="287" key="FileChooserDialogImpl/-1920.0.1920.1040/0.0.1920.1040@0.0.1920.1040" timestamp="1607278759015" />
<state width="1877" height="266" key="GridCell.Tab.0.bottom" timestamp="1607533993744">
<state width="1877" height="386" key="GridCell.Tab.0.bottom" timestamp="1607708721938">
<screen x="0" y="0" width="1920" height="1040" />
</state>
<state width="1877" height="304" key="GridCell.Tab.0.bottom/-1920.0.1920.1040/0.0.1920.1040@-1920.0.1920.1040" timestamp="1607175230302" />
<state width="1877" height="266" key="GridCell.Tab.0.bottom/-1920.0.1920.1040/0.0.1920.1040@0.0.1920.1040" timestamp="1607533993744" />
<state width="1877" height="266" key="GridCell.Tab.0.center" timestamp="1607533993744">
<state width="1877" height="386" key="GridCell.Tab.0.bottom/-1920.0.1920.1040/0.0.1920.1040@-1920.0.1920.1040" timestamp="1607708629475" />
<state width="1877" height="386" key="GridCell.Tab.0.bottom/-1920.0.1920.1040/0.0.1920.1040@0.0.1920.1040" timestamp="1607708721938" />
<state width="1877" height="386" key="GridCell.Tab.0.center" timestamp="1607708721938">
<screen x="0" y="0" width="1920" height="1040" />
</state>
<state width="1877" height="304" key="GridCell.Tab.0.center/-1920.0.1920.1040/0.0.1920.1040@-1920.0.1920.1040" timestamp="1607175230302" />
<state width="1877" height="266" key="GridCell.Tab.0.center/-1920.0.1920.1040/0.0.1920.1040@0.0.1920.1040" timestamp="1607533993744" />
<state width="1877" height="266" key="GridCell.Tab.0.left" timestamp="1607533993743">
<state width="1877" height="386" key="GridCell.Tab.0.center/-1920.0.1920.1040/0.0.1920.1040@-1920.0.1920.1040" timestamp="1607708629474" />
<state width="1877" height="386" key="GridCell.Tab.0.center/-1920.0.1920.1040/0.0.1920.1040@0.0.1920.1040" timestamp="1607708721938" />
<state width="1877" height="386" key="GridCell.Tab.0.left" timestamp="1607708721938">
<screen x="0" y="0" width="1920" height="1040" />
</state>
<state width="1877" height="304" key="GridCell.Tab.0.left/-1920.0.1920.1040/0.0.1920.1040@-1920.0.1920.1040" timestamp="1607175230302" />
<state width="1877" height="266" key="GridCell.Tab.0.left/-1920.0.1920.1040/0.0.1920.1040@0.0.1920.1040" timestamp="1607533993743" />
<state width="1877" height="266" key="GridCell.Tab.0.right" timestamp="1607533993744">
<state width="1877" height="386" key="GridCell.Tab.0.left/-1920.0.1920.1040/0.0.1920.1040@-1920.0.1920.1040" timestamp="1607708629474" />
<state width="1877" height="386" key="GridCell.Tab.0.left/-1920.0.1920.1040/0.0.1920.1040@0.0.1920.1040" timestamp="1607708721938" />
<state width="1877" height="386" key="GridCell.Tab.0.right" timestamp="1607708721938">
<screen x="0" y="0" width="1920" height="1040" />
</state>
<state width="1877" height="304" key="GridCell.Tab.0.right/-1920.0.1920.1040/0.0.1920.1040@-1920.0.1920.1040" timestamp="1607175230302" />
<state width="1877" height="266" key="GridCell.Tab.0.right/-1920.0.1920.1040/0.0.1920.1040@0.0.1920.1040" timestamp="1607533993744" />
<state width="1877" height="386" key="GridCell.Tab.0.right/-1920.0.1920.1040/0.0.1920.1040@-1920.0.1920.1040" timestamp="1607708629475" />
<state width="1877" height="386" key="GridCell.Tab.0.right/-1920.0.1920.1040/0.0.1920.1040@0.0.1920.1040" timestamp="1607708721938" />
<state x="782" y="240" key="RollbackChangesDialog" timestamp="1607174263188">
<screen x="0" y="0" width="1920" height="1040" />
</state>
@ -235,14 +259,18 @@
<screen x="0" y="0" width="1920" height="1040" />
</state>
<state x="461" y="165" key="SettingsEditor/-1920.0.1920.1040/0.0.1920.1040@0.0.1920.1040" timestamp="1607081830252" />
<state x="92" y="92" width="1736" height="856" key="com.intellij.history.integration.ui.views.FileHistoryDialog" timestamp="1607177137138">
<state x="92" y="92" width="1736" height="856" key="com.intellij.history.integration.ui.views.FileHistoryDialog" timestamp="1607705394476">
<screen x="0" y="0" width="1920" height="1040" />
</state>
<state x="92" y="92" width="1736" height="856" key="com.intellij.history.integration.ui.views.FileHistoryDialog/-1920.0.1920.1040/0.0.1920.1040@0.0.1920.1040" timestamp="1607177137138" />
<state x="593" y="141" width="585" height="801" key="find.popup" timestamp="1607533841136">
<state x="92" y="92" width="1736" height="856" key="com.intellij.history.integration.ui.views.FileHistoryDialog/-1920.0.1920.1040/0.0.1920.1040@0.0.1920.1040" timestamp="1607705394476" />
<state x="92" y="92" width="1736" height="856" key="com.intellij.history.integration.ui.views.SelectionHistoryDialog" timestamp="1607708043376">
<screen x="0" y="0" width="1920" height="1040" />
</state>
<state x="593" y="141" width="585" height="801" key="find.popup/-1920.0.1920.1040/0.0.1920.1040@0.0.1920.1040" timestamp="1607533841136" />
<state x="92" y="92" width="1736" height="856" key="com.intellij.history.integration.ui.views.SelectionHistoryDialog/-1920.0.1920.1040/0.0.1920.1040@0.0.1920.1040" timestamp="1607708043376" />
<state x="593" y="141" width="585" height="801" key="find.popup" timestamp="1607700424475">
<screen x="0" y="0" width="1920" height="1040" />
</state>
<state x="593" y="141" width="585" height="801" key="find.popup/-1920.0.1920.1040/0.0.1920.1040@0.0.1920.1040" timestamp="1607700424475" />
<state x="623" y="225" width="672" height="678" key="search.everywhere.popup" timestamp="1607081728725">
<screen x="0" y="0" width="1920" height="1040" />
</state>

142
day11/day11.go Normal file

@ -0,0 +1,142 @@
package main
import (
"AoC2020/helper"
"fmt"
"os"
)
func main() {
args := os.Args[1:]
input, err := helper.GetInput(args[0])
if err != nil {
fmt.Println(err)
}
fields := setFields(input)
printFields(fields)
fmt.Println(countOccupiedSeat(runMachine(fields, getOcuupiedNeighbours, 4)))
fmt.Println(countOccupiedSeat(runMachine(fields, getOccupiedVisibleSeats, 5)))
}
func runMachine(field [][]rune, neighbourFunction func(int, int, [][]rune) int, maxOccupied int) [][]rune {
changed := true
for changed {
newField := run(field, neighbourFunction, maxOccupied)
changed = !fieldsEqual(newField, field)
field = newField
}
return field
}
func run(fields [][]rune, neighbourFunction func(int, int, [][]rune) int, maxOccupied int) [][]rune {
var newField = make([][]rune, len(fields))
for i, _ := range newField {
newField[i] = make([]rune, len(fields[0]))
copy(newField[i], fields[i])
}
for i := 0; i < len(fields[0]); i++ {
for j := 0; j < len(fields); j++ {
if fields[j][i] == 'L' && neighbourFunction(i, j, fields) == 0 {
newField[j][i] = '#'
}
if fields[j][i] == '#' && neighbourFunction(i, j, fields) >= maxOccupied {
newField[j][i] = 'L'
}
}
}
return newField
}
func fieldsEqual(field1 [][]rune, field2 [][]rune) bool {
for i := 0; i < len(field1[0]); i++ {
for j := 0; j < len(field1); j++ {
if field1[j][i] != field2[j][i] {
return false
}
}
}
return true
}
func getOcuupiedNeighbours(x int, y int, field [][]rune) int {
neighbours := [][]int{{x - 1, y - 1}, {x, y - 1}, {x + 1, y - 1}, {x + 1, y}, {x + 1, y + 1}, {x, y + 1}, {x - 1, y + 1}, {x - 1, y}}
count := 0
for _, val := range neighbours {
if isOccupied(val[0], val[1], field) {
count++
}
}
return count
}
func getOccupiedVisibleSeats(x int, y int, field [][]rune) int {
directions := [][]int{{-1, -1}, {0,-1}, {1,-1}, {+1, 0}, {1,1}, {0,1}, {-1,1}, {-1, 0}}
count := 0
for _, val := range directions {
if getVisibleSeat(x, y, val, field) == '#' {
count++
}
}
return count
}
func getVisibleSeat(x int, y int, direction []int, field [][]rune) rune {
px := x + direction[0]
py := y + direction[1]
for py < len(field) && py >= 0 && px < len(field[0]) && px >= 0 {
if field[py][px] != '.' {
return field[py][px]
}
px += direction[0]
py += direction[1]
}
return '.'
}
func isOccupied(x int, y int, field [][]rune) bool {
if y > len(field)-1 || y < 0 {
return false
}
if x > len(field[0])-1 || x < 0 {
return false
}
if field[y][x] == 35 {
return true
}
return false
}
func printFields(fields [][]rune) {
for _, val := range fields {
fmt.Println(string(val))
}
fmt.Println()
}
func setFields(input []string) [][]rune {
var field = make([][]rune, len(input))
for i, val := range input {
field[i] = stringToRuneArr(val)
}
return field
}
func stringToRuneArr(input string) []rune {
var arr = make([]rune, len(input))
for i, val := range input {
arr[i] = val
}
return arr
}
func countOccupiedSeat(field [][]rune) int {
count := 0
for i := 0; i < len(field[0]); i++ {
for j := 0; j < len(field); j++ {
if field[j][i] == '#' {
count++
}
}
}
return count
}

91
day11/day11Input.txt Normal file

@ -0,0 +1,91 @@
LLLLLLLLLLLLLL.LLLLLLLLLLLLLLLLLLLLLLL.LLLL.L.LLLLLLL.LLLLLLL.LLLLLL.LL.LLLL.LLLLLLLLLLLLLLL
LLL.LLLLL.LLLLLLLLLLL.LLLLLLLLL.LLLLLL.LLLL.LLLLLLLLL.LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLL
LLLLLLLLL.LLLL.LLLLLLLLLL.LLLLLLL.LLLL.LLL....LLL.LLL.LLLLLLL.LLL.LLLLL.LLLLLLLL.LLLLLLLLLLL
LLLLLLLLLLLLLL.LLLLLL.LLLLLLLLL.LLLLLL.LLLL.LLL.LLLLL.LLLLLLL.LLLLLLLLL.LLLLLLLLLLLLLLLLLLLL
LLLL.LLLL.LLLL.LLLLLL.LLLLLLLLL.LLLLLL.LLLL.LLLLLLLLL.LLLLLLL.LLL.LLLLL.LLLLLLLL.LLLLLLLLLLL
LLLLLLLLLLLLLL.LLLLLLLLLLLLLLLLL.LLLLL.LLLL.LLLLLLL.L.LLL.LLL.LLLLLLLLL.LLLLLLLL.LLLLLLLLLLL
LLLLLLLLL.LLLL.LLLLLL.LLLLLLLLLLLLLLLL.LLLLLLLLLLLLLL.LLLLLLL.LLLLLLLLL.LLLLLLLL.LLL..LL.LLL
LLLLLLLLL.LLLLLLLLLLL.LLLLL.LLL.LLLLLL.LLLL.LL.L.LLLL.LLLLLLL.LLLLLLLLL.LLLLLLLLLLLLLLLLLLLL
LLLLLLLLLLLLLL.LLLLLL.L.LLLLLLLLLL.LLL.LLLL.LLLLLLLLLLLLL.LLL.LLLLLLLLLLLLLLLLLL.LLLLLLLLLLL
....L..L....L...L.......L.LL.....L..L...LLLL.LLL..L.L...LL..L...LL.....L..LL.....L....L.L..L
LLLLLLLLLLLLLL.LLLLLL.LLLLLLLLL.LLLLLLLLLLL.LLLLLLLLLLLL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LL.LL.LL
L.LLLLL.LL
..L.L.....
LLLLLLLLLL
L.LLLLLL.L
L.LLLLL.LL

9
day11/day11Test2.txt Normal file

@ -0,0 +1,9 @@
.......#.
...#.....
.#.......
.........
..#L....#
....#....
.........
#........
...#.....

7
day11/day11Test3.txt Normal file

@ -0,0 +1,7 @@
.##.##.
#.#.#.#
##...##
...L...
##...##
#.#.#.#
.##.##.

@ -0,0 +1,10 @@
#.##.##.##
#######.##
#.#.#..#..
####.##.##
#.##.##.##
#.#####.##
..#.#.....
##########
#.######.#
#.#####.##