Day 14
This commit is contained in:
24
day14/ex1/main.go
Normal file
24
day14/ex1/main.go
Normal file
@@ -0,0 +1,24 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"aoc2022/day14/common"
|
||||
"bufio"
|
||||
"fmt"
|
||||
"os"
|
||||
)
|
||||
|
||||
func main() {
|
||||
rockStructures := common.Parse(*bufio.NewScanner(os.Stdin))
|
||||
tileMap := common.NewMap()
|
||||
|
||||
for _, rockStructure := range rockStructures {
|
||||
tileMap.AddRockStructure(rockStructure)
|
||||
}
|
||||
|
||||
units := 0
|
||||
for tileMap.DropSand() {
|
||||
units++
|
||||
}
|
||||
|
||||
fmt.Println(units)
|
||||
}
|
||||
Reference in New Issue
Block a user