Skip to content

Solve 2015-20 #9

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ All currently implemented puzzles run in 200ms or less.
| 17 | No Such Thing as Too Much | ❌ | ❌ |
| 18 | Like a GIF For Your Yard | ❌ | ❌ |
| 19 | Medicine for Rudolph | ❌ | ❌ |
| 20 | Infinite Elves and Infinite Houses | ❌ | ❌ |
| 20 | [Infinite Elves and Infinite Houses](puzzles/2015/2015-20/) | ❌ | ❌ |
| 21 | RPG Simulator 20XX | ❌ | ❌ |
| 22 | Wizard Simulator 20XX | ❌ | ❌ |
| 23 | Opening the Turing Lock | ❌ | ❌ |
Expand Down
6 changes: 6 additions & 0 deletions puzzles/2015/2015-20/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[package]
name = "puzzle-2015-20"
edition = "2024"

[dependencies]
ornament.workspace = true
1 change: 1 addition & 0 deletions puzzles/2015/2015-20/input.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
33100000
15 changes: 15 additions & 0 deletions puzzles/2015/2015-20/src/lib.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
mod part1;

pub use part1::part_1;

#[cfg(test)]
mod tests {
const INPUT: &str = include_str!("../input.txt");

#[test]
fn part_1() {
use super::part_1;

assert_eq!(part_1(INPUT), 776160);
}
}
17 changes: 17 additions & 0 deletions puzzles/2015/2015-20/src/main.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
use ornament::{Puzzle, Solution};
use puzzle_2015_20::part_1;

fn main() {
Puzzle {
name: "Infinite Elves and Infinite Houses",
year: 2015,
day: 20,
part_1: |input| {
Solution::new(part_1, input, |answer| {
format!("{answer} is the lowest house number")
})
},
part_2: None,
}
.solve(include_str!("../input.txt"))
}
3 changes: 3 additions & 0 deletions puzzles/2015/2015-20/src/part1.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
pub fn part_1(input: &str) -> usize {
todo!()
}
Loading