~deciduously/aoc2020

366220d3aa65f1a83ebe5b953d3c8830769ab3ea — Ben Lovy 1 year, 6 months ago 9a84bd9
Add newlines to source files
8 files changed, 8 insertions(+), 8 deletions(-)

M LICENSE
M README.md
M aoc.nim
M day1.nim
M day2.nim
M day3.nim
M day5.nim
M helpers.nim
M LICENSE => LICENSE +1 -1
@@ 8,4 8,4 @@ Redistribution and use in source and binary forms, with or without modification,

3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
\ No newline at end of file
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIAB

M README.md => README.md +1 -1
@@ 4,4 4,4 @@ Advent of Code 2020 in Nim.

## Usage

Install [Nim](https://nim-lang.org/install.html).  Run `nim compile --run aoc.nim 1`.  Pass the desired day to execute.  It will place the `aoc` binary in the current directio for subsequent runs with, e.g. `./aoc 1`.
\ No newline at end of file
Install [Nim](https://nim-lang.org/install.html).  Run `nim compile --run aoc.nim 1`.  Pass the desired day to execute.  It will place the `aoc` binary in the current directio for subsequent runs with, e.g. `./aoc 1`.

M aoc.nim => aoc.nim +1 -1
@@ 53,4 53,4 @@ proc main() =
    runDay(day)
    quit(0)
    
main()
\ No newline at end of file
main()

M day1.nim => day1.nim +1 -1
@@ 36,4 36,4 @@ proc day1*() =
    let raw = readLinesToStrSeq("puzzles/day1.txt")
    let input = map(raw, proc(s: string): int = parseInt(s))
    part1(input)
    part2(input)
\ No newline at end of file
    part2(input)

M day2.nim => day2.nim +1 -1
@@ 64,4 64,4 @@ proc day2*() =
    total = 0
    for line in lines:
        if part2(line): total += 1
    echo "Part 2: ", total
\ No newline at end of file
    echo "Part 2: ", total

M day3.nim => day3.nim +1 -1
@@ 72,4 72,4 @@ proc part2(input: Map) =
proc day3*() =
    var map = newMap("puzzles/day3.txt")
    part1(map)
    part2(map)
\ No newline at end of file
    part2(map)

M day5.nim => day5.nim +1 -1
@@ 76,4 76,4 @@ proc day5*() =
# echo findSeat("FBFBBFFRLR") # (44, 5) - 357
# echo findSeat("BFFFBBFRRR") # (70, 7) - 567
# echo findSeat("FFFBBBFRRR") # (14, 7) - 119
# echo findSeat("BBFFBBFRLL") # (102, 4) - 820
\ No newline at end of file
# echo findSeat("BBFFBBFRLL") # (102, 4) - 820

M helpers.nim => helpers.nim +1 -1
@@ 7,4 7,4 @@ proc readLinesToStrSeq*(name: string): seq[string] =
    for line in f.lines:
        ret.add(line)

    ret
\ No newline at end of file
    ret