-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
451 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
.#.######...####..##.###.#########.######..######..#..###...#######.####. | ||
#.#....##..#.##...#..##.#........###.#.###.#.###.###....#.###.#..##..##.. | ||
..#########.#.#..##.##....##....##.......#...###....##..#..#.#.#..#.####. | ||
.#..###.#.##...###..####.#.#..#.#.###.##.#.#......#.####..##.#####..#.##. | ||
#..#.#######..####...##..#..##.###.#####...#.###.#....##.####..#.#.#####. | ||
####.#.#..###########..#.###..#.###...###..#....#.####..###...#.##..##.#. | ||
.##...##.##.####......#.#...#.#...###.#..##.###.###.#.########.#####.#.## | ||
#....#.##..#.#..##..##.###.##.##..##..###.#.#...##....#.##..##.#.#..###.. | ||
#.##.#.#.##..#.#..#####.#.#...###.#...#####...##.##.#.#......##...#...#.. | ||
#.....#.##...##.##.#.####.#####.###..#.#.....#.###..#.######.#####.##.### | ||
##......###...#..##.#####..###..#..######..#...#..#..#..#..#..#.###.#.##. | ||
.....####..######..#.#.....###.#.##.#.##.##...##.#.######.##.#.##..#.###. | ||
#.#.##.#.....#..###..#..##.######.#..####.##.##...##...#.#...#.....###### | ||
.#.####..##...#...##.######.#.###.##.#..#...#...#..#.####.#.#####.##...#. | ||
####.##.###...####.....#..#.##..#.#..###..#.#....#.#.#....#.#..#.###....# | ||
.####.#..###...##.#.##........#.#.##.#.####..#..#..##..#..#.#.#.######.## | ||
.###.#..###...######.#..##.#########.#..........####...#.###.##..#..####. | ||
#####....######.##.#....##.####..#.###...#####.###..##..#.#.##..#..#..### | ||
.#.###.#..##.#####.####.#.#.#.#.##..#.####.##.#.#.#..#.#.#..##.#..####.## | ||
####......###.#.#...#.#.....#...##.#.#.......#.##...#..#.###.#.#####..#.. | ||
.#.##....#...#.####.###.#.###.#.#.##.#.#.##.###.#####.....##..#..##.#...# | ||
#....#...##.##.####....##...#...#.##...##.##.##...######.#.##..###.####.. | ||
#..#.#.##..####.#.#..#.#..#....####...####..#..#..###...##.#.##.#..##.... | ||
####..##.#.#.##.#####...####.#.##..##.#.#.#.##....##.#..#..##.##.#...#..# | ||
##.#...#..####..##.#.#.#.#..##..##..###.#...##...#.#.#.#.##...####.##.##. | ||
#######.#...#.####.....#.###.#..#.##.##.#####.....#.#.#..###..#....##.#.. | ||
.###....#.#.##.#...#..##..#.#...#.#.....#.##.####..###....#.#.#.###.##.## | ||
#.#.#..#.##.####...#..#..##....##.#.#...#.##..##.#.#####.###.#####.#..##. | ||
.#####.#####....####...#...#..#..#..####.#........###.##..##.#.##..#.#.## | ||
#..#..#.....#.#.##..##.#...#...###.#...###.#...##.##..##.....##.####.#... | ||
##.#.##.###..#...#######.###.###..#.##.##.#..##.....##....##.##.....##### | ||
..#..##.#.###.....#..#..#.##.###.##..###.#.....##..##.#.#.######..##..... | ||
.##..##.#.##.#.#####.....#.#....#...####.#..#.##.#..#..##.#.##.##..#...#. | ||
#.#.#..##...#.#####..#.###.##.###...##...#..##......##.#.#.#.#.#..#.#...# | ||
..###......####.######...###..#.#....#..#.....#..#.#..#.##..####.##.##... | ||
#...#..####..##....#...#..####.#..#####.######..#.######..####.##...#.#.# | ||
##..#..##.####.#..##.###.....###....#...####...#..##..#.####......##.#### | ||
.##.##.##.##....#..##.....#####.###....###..##..###..#....#.#.##..#.##### | ||
.#.##..#.###..#.#.#...#..##...##.#.#..#..#.#..###...#..#.......#.#..#.#.# | ||
###.......#.##.##.#..#..#.###.#####.##.#..###..#.#...##..#..#....###.#### | ||
.##.#....##.##.#.####.##.#####..#.####..##.##.###..##.#...##.####.#..#..# | ||
..##..###.#.#####.#.#.....#...#.#.#..##..##..##..##..#.###...#.##...#.##. | ||
.####.#.#.##.##.#...##.##..###....#..##.##..#...##.#.###...#.##.#..#.#.## | ||
#.###..#..#..###....#.#...#.#..########.##.######.#.#....##.#.##.##....## | ||
.##.#...#.#.##..#.#.##.###.##.#.....##........##.######...###...######### | ||
..##.##....#.....####....#..#..#....###.##..#.......#..##.#.##.####...##. | ||
##......##.##.###......#.####...#..#.#...#.#.##.#.#....##...##..#.#####.# | ||
##.#.####..####..#.##..#..####.#.#..#.##..####.##..#.##.#.#...##....#.... | ||
###...#..##..#.#.#.##.##.#.#.#######.#.###.#...#.##.#.....##.#....#.#.... | ||
##.#.#######.#.#....#...##.####.....####.#.##.###.#.##...#.#...#..#...### | ||
.###......##.#..##.###.#...#......##..###.#......#.#..#...#..##.#...####. | ||
##.#..#.#.###.#..#..#####...#.##.###.#.#.###...##.##..####.###.#..##.#.#. | ||
#...#.#.###......##.##...####...######..##...####.#..####.#.#..####...### | ||
##.##.#.####.##.....#..###.###...#....#..###.##....#..#...#.##.##.....#.# | ||
.####..#.#.###.....##.#....#.##.#.#..##.....#.####..##.#####.....#####..# | ||
#...###.#####..###.#...##...#.#.##..#####..##.##.##..#...##.#..###.#####. | ||
###.#####..#.####.#.#.#...#.#.#...####.###.#.#..###..#.####.##..##.#..#.. | ||
.#.....##...#.....##.#..###.#......#.##..##...####..##.#.##...#.#..#.###. | ||
.#####.#..###.##.......#############.#.#.....##...#.##.##....###.#.##..## | ||
####.#..#..#..##..#...#.#.#..##....#.########...####.####.#.###.....#.#.. | ||
.##..#.##....#.#...#.#.#...###.#.#..#.#.###.##...#.###..#...#.##.######.. | ||
#...#.####..#......#.....#######..#........###..##.#..##.#.#.#.###..##..# | ||
.#.######.###.###.....#.#.####..##...#.##....#.##.##.####..###.#####.#.#. | ||
...##...##.##..#.###.###.#......###.##.##.#.#.####.#.#..#...#...###...#.. | ||
..#....#....#.#..###.#....#####.#......#....#...#..#........#..##.###.##. | ||
#.#..##.#.####.##..##....##..#.#...#..#.#..#.#.##..#.#.####...#..#####..# | ||
.##.###.#.#.#.#.#.#.##.###.##.#.##.######.##..##.##......####....#....#.. | ||
.######..#####.#..#.#...#....###########.#.##.####.###.#....##.###..####. | ||
..#####..##.#..##.#..#..#..##.#.###.#.#......######.#..#...###....#..#### | ||
###.##...####....##..###......##.#.#...##..#.##...#.##.#.#.#.##.##.##.#.. | ||
#..#.#.##.#.#.##..#..##.###..##.####...........#..####.#.##..#...#....#.. | ||
###...#####.#..#..#.##.##...####....#.#..####.#..##..##.##.###.##.###.##. | ||
#.....##.##...###.#.#..###.#####..#.#..####..#..#...#.#...##.####.#..###. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,115 @@ | ||
2=-00=02-1 | ||
1-1=02=1220 | ||
1-000-00 | ||
12=-=0--=202-= | ||
1==0=0210-1==1--- | ||
122110--01- | ||
1-=1=-==02-12000 | ||
1=1=20- | ||
11-1-21-02221=2--= | ||
2=1--11001 | ||
210=-1020-=1-1 | ||
20-= | ||
10-000=12=21202== | ||
20222=2--21= | ||
1020010 | ||
2-=1110=-0=2- | ||
1==2=2-=1--= | ||
100- | ||
2211-==-021== | ||
1=1 | ||
1-=1--==0 | ||
20220=1=-22 | ||
12 | ||
2-=002-102-2- | ||
2-0-02 | ||
20001-020=01 | ||
1===-210--0010 | ||
2021=121-00-12=-1= | ||
1-0-0==2=1 | ||
1-=01= | ||
102=22=0=02 | ||
11=01- | ||
2=0 | ||
20=-12=2121-- | ||
111102011=0000 | ||
22--12010- | ||
1=-21202=-2=-2 | ||
1=2-=-2-1- | ||
2-=1=112-1- | ||
22= | ||
1=--20-=000=0-11=== | ||
1--== | ||
1000=1-1 | ||
1=1-01000 | ||
1=2--1=1 | ||
1=2-2=--2-00 | ||
1=00-=-0010-2 | ||
102 | ||
111101=21002= | ||
211-=01-= | ||
121--11=12022=-112 | ||
1==--0100-=0 | ||
2 | ||
1=- | ||
220=-1=10--12 | ||
10---20--00 | ||
1==1111- | ||
12-=0-0==010 | ||
2121=1 | ||
2==102=21=-2=20 | ||
201===- | ||
1-00=11-200=-111012 | ||
1-022 | ||
1==1010--011-==-22 | ||
11==20=1122=12=2-1 | ||
1--0001=22 | ||
2020==2-- | ||
1===--0-- | ||
12=2---1 | ||
1-0100=-=-1--11 | ||
122====20=--2 | ||
1-0=-01==- | ||
1-021 | ||
2-01==1=0 | ||
1=1-20=01121020==2 | ||
1=02=-2011--01=21 | ||
2-2110-=- | ||
1=-=-002-== | ||
2-=- | ||
10-0 | ||
1=0=-1= | ||
1=1=1 | ||
212-0 | ||
11100= | ||
21=202-111-1=-012-1 | ||
22-=001= | ||
11=21=0----010=-10 | ||
1=1=221 | ||
1221= | ||
1=11=20=-0112-=2-= | ||
2-1-02001 | ||
12-=0=120-1=--20=- | ||
2=1--- | ||
2==--2=0--- | ||
10=-010 | ||
112 | ||
1-=1 | ||
1022100-= | ||
1=220001000-1-1=== | ||
2==-2-00=02=10=- | ||
21=2 | ||
2==1=02=-02 | ||
1=10 | ||
1-0202= | ||
1--2=112021=-1112222 | ||
1-122=2=-10 | ||
1--2112--011- | ||
2=1-= | ||
2211211 | ||
1=021=-000 | ||
1101 | ||
1=2=120= | ||
2=02 | ||
12-1 | ||
2-=0-=2-1-0112 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,106 @@ | ||
use anyhow::Error; | ||
use enum_iterator::Sequence; | ||
use euclid::vec2; | ||
use structopt::StructOpt; | ||
|
||
type Coord = i64; | ||
type Point = euclid::default::Point2D<Coord>; | ||
type Box = euclid::default::Box2D<Coord>; | ||
type Vector = euclid::default::Vector2D<Coord>; | ||
type Rect = euclid::default::Rect<Coord>; | ||
|
||
const DATA: &str = include_str!("../../data/day23.txt"); | ||
const SAMPLE: &str = r#"....#.. | ||
..###.# | ||
#...#.# | ||
.#...## | ||
#.###.. | ||
##.#.## | ||
.#..#.."#; | ||
|
||
#[derive(Debug, PartialEq, Eq, Clone, Copy, Sequence)] | ||
#[repr(usize)] | ||
enum Direction { | ||
North, | ||
South, | ||
West, | ||
East, | ||
} | ||
|
||
impl Direction { | ||
fn as_char(&self) -> char { | ||
(*self).into() | ||
} | ||
} | ||
|
||
impl Into<Vector> for Direction { | ||
fn into(self) -> Vector { | ||
match self { | ||
Direction::North => vec2(0, -1), | ||
Direction::East => vec2(1, 0), | ||
Direction::South => vec2(0, 1), | ||
Direction::West => vec2(-1, 0), | ||
} | ||
} | ||
} | ||
|
||
impl Into<char> for Direction { | ||
fn into(self) -> char { | ||
match self { | ||
Direction::North => '^', | ||
Direction::East => '>', | ||
Direction::South => 'v', | ||
Direction::West => '<', | ||
} | ||
} | ||
} | ||
|
||
fn parse(_s: &str) -> () {} | ||
|
||
fn solve_part_1() -> usize { | ||
todo!(); | ||
} | ||
|
||
fn solve_part_2() -> usize { | ||
todo!(); | ||
} | ||
|
||
#[derive(Debug, StructOpt)] | ||
#[structopt(name = "day24", about = "Blizzard Basin")] | ||
struct Opt { | ||
/// Use puzzle input instead of the sample | ||
#[structopt(short, long)] | ||
puzzle_input: bool, | ||
} | ||
|
||
fn main() -> Result<(), Error> { | ||
let opt = Opt::from_args(); | ||
|
||
let _ = parse(if opt.puzzle_input { DATA } else { SAMPLE }); | ||
|
||
let p1 = solve_part_1(); | ||
println!("part 1 = {}", p1); | ||
|
||
println!("part 2 = {}", solve_part_2()); | ||
|
||
Ok(()) | ||
} | ||
|
||
#[cfg(test)] | ||
mod test { | ||
use super::*; | ||
|
||
#[test] | ||
fn test_parse() { | ||
let _ = parse(SAMPLE); | ||
todo!(); | ||
} | ||
|
||
#[test] | ||
#[ignore] | ||
fn test_part_1() {} | ||
|
||
#[test] | ||
#[ignore] | ||
fn test_part_2() {} | ||
} |
Oops, something went wrong.