Code Monkey home page Code Monkey logo

aoc2023's Introduction

Advent of Code 2023

This repository contains my solutions for the Advent of Code 2023. It marks my first serious foray into Rust programming, with my initial exposure to the language dating back over a year ago. However, that initial interaction was brief and exploratory, lasting only a couple of days. The primary objective of this project was to serve as a Rust training ground, allowing me to gradually build my skills in the language. I embarked on this journey with the hope that the code quality would improve day by day as I delved deeper into Rust development. This repository stands as a testament to my learning progress and commitment to mastering Rust over time.

Scaffolding a New AoC Day

To scaffold the code needed for a new AoC day, use the new-day.sh script. Run it in your terminal as follows:

./new-day.sh <DAY>

Replace <DAY> is the day number. e.g. ./new-day.sh 01

Fetching Input for a Given Day

To fetch the input for a given day, use the fetch-input.sh script. Run it in your terminal as follows:

./fetch-input.sh <DAY>

Replace <DAY> with the day number. e.g. ./fetch-input.sh 01

Building the Binaries

To build the binaries, use the cargo build command. For a debug build, run:

cargo build

For a release build, run:

cargo build --release

Executing Binaries

To execute the binaries in debug mode, use the cargo run command:

cargo run --bin day-<DAY> <INPUT_FILE>

To execute them in release mode, use:

cargo run --release --bin day-<DAY> <INPUT_FILE>

Replace <DAY> with the day number and <INPUT_FILE> with the path to the input file. e.g. cargo run --bin day-01 inputs/day-01.txt

Executing Binaries Without Cargo

To execute the binaries without using cargo, navigate to the target/debug or target/release directory and run:

./day-<DAY> <INPUT_FILE>

Replace <DAY> with the day number and <INPUT_FILE> with the path to the input file. e.g. target/release/day-01 inputs/day-01.txt

Input File Argument

All binaries take a single argument that is the path to the input file. For example:

target/release/day-01 inputs/day-01.txt

My input files can be found in the inputs directory and sample input files can be found in the sample-inputs directory.

Output

Depending on personal life time constraints and how the problem was approached, every binary either outputs the answer to both parts of the AoC question or only the second part.

aoc2023's People

Contributors

yassineelbouchaibi 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.