From 42d678b8caf952e4a4184c06be76bc3a18a9b035 Mon Sep 17 00:00:00 2001 From: Stefan Harmuth Date: Sun, 14 Nov 2021 17:59:20 +0100 Subject: [PATCH] playing around with input methods; adding day01 input --- aoc2017.iml | 38 ++++++++++++++++++++++ src/de/domainforge/aoc2017/Day01.java | 20 ++++++++++++ src/resources/input01 | 1 + test/de/domainforge/aoc2017/Day01Test.java | 16 +++++++++ test/resources/input01_1_1 | 2 ++ test/resources/input01_1_2 | 2 ++ test/resources/input01_1_3 | 2 ++ test/resources/input01_1_4 | 2 ++ 8 files changed, 83 insertions(+) create mode 100644 src/de/domainforge/aoc2017/Day01.java create mode 100644 src/resources/input01 create mode 100644 test/de/domainforge/aoc2017/Day01Test.java create mode 100644 test/resources/input01_1_1 create mode 100644 test/resources/input01_1_2 create mode 100644 test/resources/input01_1_3 create mode 100644 test/resources/input01_1_4 diff --git a/aoc2017.iml b/aoc2017.iml index c90834f..d7aced9 100644 --- a/aoc2017.iml +++ b/aoc2017.iml @@ -4,8 +4,46 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/de/domainforge/aoc2017/Day01.java b/src/de/domainforge/aoc2017/Day01.java new file mode 100644 index 0000000..e51e84b --- /dev/null +++ b/src/de/domainforge/aoc2017/Day01.java @@ -0,0 +1,20 @@ +package de.domainforge.aoc2017; + +import de.domainforge.tools.AOCDay; + +public class Day01 extends AOCDay { + public Day01(String input) { + super(input); + } + + @Override + public String part1() { + int[] input = this.getInputIntArray(); + return String.valueOf(input[0]); + } + + @Override + public String part2() { + return "bar"; + } +} diff --git a/src/resources/input01 b/src/resources/input01 new file mode 100644 index 0000000..3af3b68 --- /dev/null +++ b/src/resources/input01 @@ -0,0 +1 @@ +516299281491169512719425276194596424291268712697155863651846937925928456958813624428156218468331423858422613471962165756423837756856519754524985759763747559711257977361228357678293572698839754444752898835313399815748562519958329927911861654784216355489319995566297499836295985943899373615223375271231128914745273184498915241488393761676799914385265459983923743146555465177886491979962465918888396664233693243983969412682561799628789569294374554575677368219724142536789649121758582991345537639888858113763738518511184439854223386868764189133964543721941169786274781775658991329331759679943342217578532643519615296424396487669451453728113114748217177826874953466435436129165295379157226345786756899935747336785161745487933721527239394118721517195849186676814232887413175587327214144876898248571248517121796766248817366614333915154796983612174281237846165129114988453188844745119798643314857871527757831265298846833327863781341559381238458322786192379487455671563757123534253463563421716138641611915686247343417126655317378639314168461345613427262786624689498485599942336813995725145169355942616672812792174556866436158375938988738721253664772584577384558696477546232189312287262439452141564522329987139692281984783513691857538335537553448919819545332125483128878925492334361562192621672993868479566688564752226111784486619789588318171745995253645886833872665447241245329935643883892447524286642296955354249478815116517315832179925494818748478164317669471654464867111924676961162162841232473474394739793968624974397916495667233337397241933765513777241916359166994384923869741468174653353541147616645393917694581811193977311981752554551499629219873391493426883886536219455848354426461562995284162323961773644581815633779762634745339565196798724847722781666948626231631632144371873154872575615636322965353254642186897127423352618879431499138418872356116624818733232445649188793318829748789349813295218673497291134164395739665667255443366383299669973689528188264386373591424149784473698487315316676637165317972648916116755224598519934598889627918883283534261513179931798591959489372165295 \ No newline at end of file diff --git a/test/de/domainforge/aoc2017/Day01Test.java b/test/de/domainforge/aoc2017/Day01Test.java new file mode 100644 index 0000000..0fc47f9 --- /dev/null +++ b/test/de/domainforge/aoc2017/Day01Test.java @@ -0,0 +1,16 @@ +package de.domainforge.aoc2017; + +import org.junit.jupiter.api.Test; + +import static org.junit.jupiter.api.Assertions.*; + +class Day01Test { + + @Test + void part1() { + } + + @Test + void part2() { + } +} \ No newline at end of file diff --git a/test/resources/input01_1_1 b/test/resources/input01_1_1 new file mode 100644 index 0000000..7fdc975 --- /dev/null +++ b/test/resources/input01_1_1 @@ -0,0 +1,2 @@ +3 +1122 \ No newline at end of file diff --git a/test/resources/input01_1_2 b/test/resources/input01_1_2 new file mode 100644 index 0000000..3108d11 --- /dev/null +++ b/test/resources/input01_1_2 @@ -0,0 +1,2 @@ +4 +1111 \ No newline at end of file diff --git a/test/resources/input01_1_3 b/test/resources/input01_1_3 new file mode 100644 index 0000000..6d0f86b --- /dev/null +++ b/test/resources/input01_1_3 @@ -0,0 +1,2 @@ +0 +1234 \ No newline at end of file diff --git a/test/resources/input01_1_4 b/test/resources/input01_1_4 new file mode 100644 index 0000000..64f0b35 --- /dev/null +++ b/test/resources/input01_1_4 @@ -0,0 +1,2 @@ +9 +91212129 \ No newline at end of file