diff options
author | tchojnacki <tomaszchojnacki2001@gmail.com> | 2022-08-05 13:41:15 +0200 |
---|---|---|
committer | tchojnacki <tomaszchojnacki2001@gmail.com> | 2022-08-05 13:41:15 +0200 |
commit | 0c97ce0ce9cf56b927c875a00fbe417dc7593a48 (patch) | |
tree | 19eda6547f0a77d9817de58f32aeedbd5bec069e /src/Day13.kt | |
parent | f0337d4e76124bcd81f2ef3f00ac297926d7f767 (diff) | |
download | gleam_aoc2020-0c97ce0ce9cf56b927c875a00fbe417dc7593a48.tar.gz gleam_aoc2020-0c97ce0ce9cf56b927c875a00fbe417dc7593a48.zip |
Minor refactoring of previous days
Diffstat (limited to 'src/Day13.kt')
-rw-r--r-- | src/Day13.kt | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/Day13.kt b/src/Day13.kt index f37c527..c8bb8c6 100644 --- a/src/Day13.kt +++ b/src/Day13.kt @@ -16,7 +16,7 @@ sealed class FoldCommand { .toSet() } - class AlongY(val y: Int) : FoldCommand() { + class AlongY(private val y: Int) : FoldCommand() { override fun dispatch(dots: Set<Pos2D>): Set<Pos2D> = dots .filter { it.y != y } .map { @@ -62,9 +62,7 @@ fun main() { fun part1(input: List<String>): Int { val (dots, commands) = parseOrigami(input) - val res = commands.first().dispatch(dots).size - - return res + return commands.first().dispatch(dots).size } fun part2(input: List<String>): String { |