Skip to content

Jan-Loettgen/advent_of_code_22

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Advent of Code 2022 in Rust

This repository contains my solutions to the Advent of Code 2022, implemented in Rust. I am working through the problems after the actual time of the challenge as I did not have to to compete in December. This is a side project I am working on to learn to improve my rust programming skills after having have read the book. All of the implemented solutions are my own attempt without having have looked at the solutions before so the solutions will liekly be suboptimal. Lastly as I am still learning rust the implementations will likely also be suboptimal.

Approach:

  1. Brute force.
  2. Hard coded.
  3. Brute force.
  4. Brute force.
  5. Brute force.
  6. Brute force.
  7. Recursive brute force.
  8. Brute force.
  9. Brute force.
  10. Brute force.
  11. Modular arithmetic.
  12. Part 1: A*. Part 2: Dijkstra. Both animated in terminal.
  13. Part 1: Recursion, Nested list parser. Part 2: Bubble sort.
  14. Brute force. Drawable.

To use:

Like will only run on an ubuntu based system, as characters in the text files will be different on different operating systems. E.g. windows adds a carriage return before end of line in a text file.

Go to src/main.rs and comment or uncomment the solve functions corresponding to each day. The solve functions takes as input an integer 1 for problem 1, 2 for problem 2. The day 12 problems are animated in the terminal, providing an argument of false to the day 12 solve() call will disable the animations. Build and run the code via "cargo run", and the solutions will be printed to the terminal.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages