Tried to work on Day 10 on my Chromebook but yeah...
This commit is contained in:
@@ -2,10 +2,15 @@ package com.basdado.adventofcode
|
||||
|
||||
import java.nio.file.Files
|
||||
import java.nio.file.Paths
|
||||
import java.nio.file.FileSystems
|
||||
import java.util.stream.Stream
|
||||
|
||||
fun lines(resourceFile: String): Stream<String> {
|
||||
return Files.lines(Paths.get(Utils::class.java.getResource(resourceFile).toURI()))
|
||||
|
||||
val uri = Paths.get(Utils::class.java.getResource(resourceFile).toURI())
|
||||
val env = mapOf(Pair("create", "true"))
|
||||
FileSystems.newFileSystem(uri, env)
|
||||
return Files.lines(uri)
|
||||
}
|
||||
|
||||
fun line(resourceFile: String): String {
|
||||
|
||||
33
src/main/kotlin/com/basdado/adventofcode/day10/Day10.kt
Normal file
33
src/main/kotlin/com/basdado/adventofcode/day10/Day10.kt
Normal file
@@ -0,0 +1,33 @@
|
||||
const val DAY10_INPUT_PATH = "/day/10/input.txt"
|
||||
|
||||
import com.basdado.adventofcode.lines;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
fun main() {
|
||||
|
||||
Day10.puzzle1()
|
||||
// Day10.puzzle2()
|
||||
}
|
||||
|
||||
object Day10 {
|
||||
|
||||
fun puzzle1() {
|
||||
println("Hello world!")
|
||||
val rawData = lines(DAY10_INPUT_PATH).collect(Collectors.toList())
|
||||
val asteroids =
|
||||
(0..rawData.size).forEach { y ->
|
||||
(0..rawData[y].length).forEach { x ->
|
||||
if (rawData[y][x] == '#') {
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
data class Vector2i(val x: Int, val y: Int) {
|
||||
fun normalize(): Vector2i {
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
36
src/main/resources/day/10/input.txt
Normal file
36
src/main/resources/day/10/input.txt
Normal file
@@ -0,0 +1,36 @@
|
||||
....#...####.#.#...........#........
|
||||
#####..#.#.#......#####...#.#...#...
|
||||
##.##..#.#.#.....#.....##.#.#..#....
|
||||
...#..#...#.##........#..#.......#.#
|
||||
#...##...###...###..#...#.....#.....
|
||||
##.......#.....#.........#.#....#.#.
|
||||
..#...#.##.##.....#....##..#......#.
|
||||
..###..##..#..#...#......##...#....#
|
||||
##..##.....#...#.#...#......#.#.#..#
|
||||
...###....#..#.#......#...#.......#.
|
||||
#....#...##.......#..#.......#..#...
|
||||
#...........#.....#.....#.#...#.##.#
|
||||
###..#....####..#.###...#....#..#...
|
||||
##....#.#..#.#......##.......#....#.
|
||||
..#.#....#.#.#..#...#.##.##..#......
|
||||
...#.....#......#.#.#.##.....#..###.
|
||||
..#.#.###.......#..#.#....##.....#..
|
||||
.#.#.#...#..#.#..##.#..........#...#
|
||||
.....#.#.#...#..#..#...###.#...#.#..
|
||||
#..#..#.....#.##..##...##.#.....#...
|
||||
....##....#.##...#..........#.##....
|
||||
...#....###.#...##........##.##..##.
|
||||
#..#....#......#......###...........
|
||||
##...#..#.##.##..##....#..#..##..#.#
|
||||
.#....#..##.....#.#............##...
|
||||
.###.........#....#.##.#..#.#..#.#..
|
||||
#...#..#...#.#.#.....#....#......###
|
||||
#...........##.#....#.##......#.#..#
|
||||
....#...#..#...#.####...#.#..#.##...
|
||||
......####.....#..#....#....#....#.#
|
||||
.##.#..###..####...#.......#.#....#.
|
||||
#.###....#....#..........#.....###.#
|
||||
...#......#....##...##..#..#...###..
|
||||
..#...###.###.........#.#..#.#..#...
|
||||
.#.#.............#.#....#...........
|
||||
..#...#.###...##....##.#.#.#....#.#.
|
||||
Reference in New Issue
Block a user