Giter Club home page Giter Club logo

aoc2023's Introduction

Advent of Code 2023

Solutions for Advent of Code 2023. Each day in a folder.

Day 1:

Chosen solution: Bash Scripts

Using awk exclusively. Successfully provides solution for both part one and two of the Day 1 challenge. Each script takes a single parameter, which is the given input file as plain text.

Example run Part 1: 'sh aoc1p1.sh '

Example run Part 2: 'sh aoc1p2.sh '

Ran/developed on Raspbian bullseye on Pi400.

Day 2:

Chosen solution: C++

Hamfisted approach with minimal C++ skillset. I would like to redo this with better error handling and building out parts as separate functions. Right now it's a mess of while loops with if statements.

but it works

Part 1:

Simple Build: g++ -o d2p1 d2p1_main.cpp

Run With: ./d2p1 <inputfile> -R <red_int> -G <green_int> -B <blue_int>

Part 2:

Able to reuse a large portion of the program for part 1. Removed a chunk of unneeded functionaltiy - and added in the multiplication and summation parts.

Simple Build: g++ -o d2p2 d2p2_main.cpp

Run With: ./d2p2 <inputfile>

Ran/developed on Raspbian bullseye on Pi400.

Day 3:

Chosen solution: C++

Part 1:

This is probably the messiest thing anyone has ever seen. Essentially - create and array of strings, and while/if/for iterations through each row, column, and individual character to eventually get the solution. May or may not be able to re-use any of this for part 2...

Simple Build: g++ -o d2p2 d3p1_main.cpp

Run With: ./d3p1 <inputfile>

Part 2:

Used the bulk of part 1 for this. Changed the way the number check and accumulation was working. Added some additional functions for dealing with arrays. Login on this one was to find all of the coordinates of the stars, and then list the number the star was touching.

Once the coordinates and touching numbers have been identified - pass the vector to a function that will find coordinate matches (multiple numbers touching the same star at [row][column]) - and multiply them - summing the products of each.

Simple Build: g++ -o d3p2 d3p2_main.cpp

Run With: /d3p2 <inputfile>

Day 4:

Chosen Solution: Python

Part 1:

Went with Python this round. String manipulation in C++ was taking entirely too much effort. Python has some native things to handle this in a smaller amount of code (significantly smaller).

Run with: python d4p1_main.py <inputfile>

aoc2023's People

Contributors

jackbaggins avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.