few moore days. middle of day22
This commit is contained in:
parent
14d98a5f48
commit
08cffbf2d2
@ -1 +1 @@
|
|||||||
{"rustc_fingerprint":14318102787793507742,"outputs":{"15729799797837862367":{"success":true,"status":"","code":0,"stdout":"___\nlib___.rlib\nlib___.dylib\nlib___.dylib\nlib___.a\nlib___.dylib\n/Users/shoofle/.rustup/toolchains/stable-x86_64-apple-darwin\noff\npacked\nunpacked\n___\ndebug_assertions\npanic=\"unwind\"\nproc_macro\ntarget_arch=\"x86_64\"\ntarget_endian=\"little\"\ntarget_env=\"\"\ntarget_family=\"unix\"\ntarget_feature=\"cmpxchg16b\"\ntarget_feature=\"fxsr\"\ntarget_feature=\"sse\"\ntarget_feature=\"sse2\"\ntarget_feature=\"sse3\"\ntarget_feature=\"sse4.1\"\ntarget_feature=\"ssse3\"\ntarget_has_atomic=\"128\"\ntarget_has_atomic=\"16\"\ntarget_has_atomic=\"32\"\ntarget_has_atomic=\"64\"\ntarget_has_atomic=\"8\"\ntarget_has_atomic=\"ptr\"\ntarget_os=\"macos\"\ntarget_pointer_width=\"64\"\ntarget_vendor=\"apple\"\nunix\n","stderr":""},"4614504638168534921":{"success":true,"status":"","code":0,"stdout":"rustc 1.74.1 (a28077b28 2023-12-04)\nbinary: rustc\ncommit-hash: a28077b28a02b92985b3a3faecf92813155f1ea1\ncommit-date: 2023-12-04\nhost: x86_64-apple-darwin\nrelease: 1.74.1\nLLVM version: 17.0.4\n","stderr":""}},"successes":{}}
|
{"rustc_fingerprint":18427324047803895159,"outputs":{"12285253167677315500":{"success":true,"status":"","code":0,"stdout":"___\nlib___.rlib\nlib___.dylib\nlib___.dylib\nlib___.a\nlib___.dylib\n/Users/shoofle/.rustup/toolchains/stable-x86_64-apple-darwin\noff\npacked\nunpacked\n___\ndebug_assertions\noverflow_checks\npanic=\"unwind\"\nproc_macro\nrelocation_model=\"pic\"\ntarget_abi=\"\"\ntarget_arch=\"x86_64\"\ntarget_endian=\"little\"\ntarget_env=\"\"\ntarget_family=\"unix\"\ntarget_feature=\"cmpxchg16b\"\ntarget_feature=\"fxsr\"\ntarget_feature=\"sse\"\ntarget_feature=\"sse2\"\ntarget_feature=\"sse3\"\ntarget_feature=\"sse4.1\"\ntarget_feature=\"ssse3\"\ntarget_has_atomic\ntarget_has_atomic=\"128\"\ntarget_has_atomic=\"16\"\ntarget_has_atomic=\"32\"\ntarget_has_atomic=\"64\"\ntarget_has_atomic=\"8\"\ntarget_has_atomic=\"ptr\"\ntarget_has_atomic_equal_alignment=\"16\"\ntarget_has_atomic_equal_alignment=\"32\"\ntarget_has_atomic_equal_alignment=\"64\"\ntarget_has_atomic_equal_alignment=\"8\"\ntarget_has_atomic_equal_alignment=\"ptr\"\ntarget_has_atomic_load_store\ntarget_has_atomic_load_store=\"128\"\ntarget_has_atomic_load_store=\"16\"\ntarget_has_atomic_load_store=\"32\"\ntarget_has_atomic_load_store=\"64\"\ntarget_has_atomic_load_store=\"8\"\ntarget_has_atomic_load_store=\"ptr\"\ntarget_os=\"macos\"\ntarget_pointer_width=\"64\"\ntarget_thread_local\ntarget_vendor=\"apple\"\nunix\n","stderr":""},"4614504638168534921":{"success":true,"status":"","code":0,"stdout":"rustc 1.74.1 (a28077b28 2023-12-04)\nbinary: rustc\ncommit-hash: a28077b28a02b92985b3a3faecf92813155f1ea1\ncommit-date: 2023-12-04\nhost: x86_64-apple-darwin\nrelease: 1.74.1\nLLVM version: 17.0.4\n","stderr":""}},"successes":{}}
|
@ -1 +1 @@
|
|||||||
{"rustc_fingerprint":14318102787793507742,"outputs":{"4614504638168534921":{"success":true,"status":"","code":0,"stdout":"rustc 1.74.1 (a28077b28 2023-12-04)\nbinary: rustc\ncommit-hash: a28077b28a02b92985b3a3faecf92813155f1ea1\ncommit-date: 2023-12-04\nhost: x86_64-apple-darwin\nrelease: 1.74.1\nLLVM version: 17.0.4\n","stderr":""},"15729799797837862367":{"success":true,"status":"","code":0,"stdout":"___\nlib___.rlib\nlib___.dylib\nlib___.dylib\nlib___.a\nlib___.dylib\n/Users/shoofle/.rustup/toolchains/stable-x86_64-apple-darwin\noff\npacked\nunpacked\n___\ndebug_assertions\npanic=\"unwind\"\nproc_macro\ntarget_arch=\"x86_64\"\ntarget_endian=\"little\"\ntarget_env=\"\"\ntarget_family=\"unix\"\ntarget_feature=\"cmpxchg16b\"\ntarget_feature=\"fxsr\"\ntarget_feature=\"sse\"\ntarget_feature=\"sse2\"\ntarget_feature=\"sse3\"\ntarget_feature=\"sse4.1\"\ntarget_feature=\"ssse3\"\ntarget_has_atomic=\"128\"\ntarget_has_atomic=\"16\"\ntarget_has_atomic=\"32\"\ntarget_has_atomic=\"64\"\ntarget_has_atomic=\"8\"\ntarget_has_atomic=\"ptr\"\ntarget_os=\"macos\"\ntarget_pointer_width=\"64\"\ntarget_vendor=\"apple\"\nunix\n","stderr":""}},"successes":{}}
|
{"rustc_fingerprint":18427324047803895159,"outputs":{"12285253167677315500":{"success":true,"status":"","code":0,"stdout":"___\nlib___.rlib\nlib___.dylib\nlib___.dylib\nlib___.a\nlib___.dylib\n/Users/shoofle/.rustup/toolchains/stable-x86_64-apple-darwin\noff\npacked\nunpacked\n___\ndebug_assertions\noverflow_checks\npanic=\"unwind\"\nproc_macro\nrelocation_model=\"pic\"\ntarget_abi=\"\"\ntarget_arch=\"x86_64\"\ntarget_endian=\"little\"\ntarget_env=\"\"\ntarget_family=\"unix\"\ntarget_feature=\"cmpxchg16b\"\ntarget_feature=\"fxsr\"\ntarget_feature=\"sse\"\ntarget_feature=\"sse2\"\ntarget_feature=\"sse3\"\ntarget_feature=\"sse4.1\"\ntarget_feature=\"ssse3\"\ntarget_has_atomic\ntarget_has_atomic=\"128\"\ntarget_has_atomic=\"16\"\ntarget_has_atomic=\"32\"\ntarget_has_atomic=\"64\"\ntarget_has_atomic=\"8\"\ntarget_has_atomic=\"ptr\"\ntarget_has_atomic_equal_alignment=\"16\"\ntarget_has_atomic_equal_alignment=\"32\"\ntarget_has_atomic_equal_alignment=\"64\"\ntarget_has_atomic_equal_alignment=\"8\"\ntarget_has_atomic_equal_alignment=\"ptr\"\ntarget_has_atomic_load_store\ntarget_has_atomic_load_store=\"128\"\ntarget_has_atomic_load_store=\"16\"\ntarget_has_atomic_load_store=\"32\"\ntarget_has_atomic_load_store=\"64\"\ntarget_has_atomic_load_store=\"8\"\ntarget_has_atomic_load_store=\"ptr\"\ntarget_os=\"macos\"\ntarget_pointer_width=\"64\"\ntarget_thread_local\ntarget_vendor=\"apple\"\nunix\n","stderr":""},"4614504638168534921":{"success":true,"status":"","code":0,"stdout":"rustc 1.74.1 (a28077b28 2023-12-04)\nbinary: rustc\ncommit-hash: a28077b28a02b92985b3a3faecf92813155f1ea1\ncommit-date: 2023-12-04\nhost: x86_64-apple-darwin\nrelease: 1.74.1\nLLVM version: 17.0.4\n","stderr":""}},"successes":{}}
|
@ -1 +1 @@
|
|||||||
{"rustc_fingerprint":14318102787793507742,"outputs":{"4614504638168534921":{"success":true,"status":"","code":0,"stdout":"rustc 1.74.1 (a28077b28 2023-12-04)\nbinary: rustc\ncommit-hash: a28077b28a02b92985b3a3faecf92813155f1ea1\ncommit-date: 2023-12-04\nhost: x86_64-apple-darwin\nrelease: 1.74.1\nLLVM version: 17.0.4\n","stderr":""},"15729799797837862367":{"success":true,"status":"","code":0,"stdout":"___\nlib___.rlib\nlib___.dylib\nlib___.dylib\nlib___.a\nlib___.dylib\n/Users/shoofle/.rustup/toolchains/stable-x86_64-apple-darwin\noff\npacked\nunpacked\n___\ndebug_assertions\npanic=\"unwind\"\nproc_macro\ntarget_arch=\"x86_64\"\ntarget_endian=\"little\"\ntarget_env=\"\"\ntarget_family=\"unix\"\ntarget_feature=\"cmpxchg16b\"\ntarget_feature=\"fxsr\"\ntarget_feature=\"sse\"\ntarget_feature=\"sse2\"\ntarget_feature=\"sse3\"\ntarget_feature=\"sse4.1\"\ntarget_feature=\"ssse3\"\ntarget_has_atomic=\"128\"\ntarget_has_atomic=\"16\"\ntarget_has_atomic=\"32\"\ntarget_has_atomic=\"64\"\ntarget_has_atomic=\"8\"\ntarget_has_atomic=\"ptr\"\ntarget_os=\"macos\"\ntarget_pointer_width=\"64\"\ntarget_vendor=\"apple\"\nunix\n","stderr":""}},"successes":{}}
|
{"rustc_fingerprint":18427324047803895159,"outputs":{"12285253167677315500":{"success":true,"status":"","code":0,"stdout":"___\nlib___.rlib\nlib___.dylib\nlib___.dylib\nlib___.a\nlib___.dylib\n/Users/shoofle/.rustup/toolchains/stable-x86_64-apple-darwin\noff\npacked\nunpacked\n___\ndebug_assertions\noverflow_checks\npanic=\"unwind\"\nproc_macro\nrelocation_model=\"pic\"\ntarget_abi=\"\"\ntarget_arch=\"x86_64\"\ntarget_endian=\"little\"\ntarget_env=\"\"\ntarget_family=\"unix\"\ntarget_feature=\"cmpxchg16b\"\ntarget_feature=\"fxsr\"\ntarget_feature=\"sse\"\ntarget_feature=\"sse2\"\ntarget_feature=\"sse3\"\ntarget_feature=\"sse4.1\"\ntarget_feature=\"ssse3\"\ntarget_has_atomic\ntarget_has_atomic=\"128\"\ntarget_has_atomic=\"16\"\ntarget_has_atomic=\"32\"\ntarget_has_atomic=\"64\"\ntarget_has_atomic=\"8\"\ntarget_has_atomic=\"ptr\"\ntarget_has_atomic_equal_alignment=\"16\"\ntarget_has_atomic_equal_alignment=\"32\"\ntarget_has_atomic_equal_alignment=\"64\"\ntarget_has_atomic_equal_alignment=\"8\"\ntarget_has_atomic_equal_alignment=\"ptr\"\ntarget_has_atomic_load_store\ntarget_has_atomic_load_store=\"128\"\ntarget_has_atomic_load_store=\"16\"\ntarget_has_atomic_load_store=\"32\"\ntarget_has_atomic_load_store=\"64\"\ntarget_has_atomic_load_store=\"8\"\ntarget_has_atomic_load_store=\"ptr\"\ntarget_os=\"macos\"\ntarget_pointer_width=\"64\"\ntarget_thread_local\ntarget_vendor=\"apple\"\nunix\n","stderr":""},"4614504638168534921":{"success":true,"status":"","code":0,"stdout":"rustc 1.74.1 (a28077b28 2023-12-04)\nbinary: rustc\ncommit-hash: a28077b28a02b92985b3a3faecf92813155f1ea1\ncommit-date: 2023-12-04\nhost: x86_64-apple-darwin\nrelease: 1.74.1\nLLVM version: 17.0.4\n","stderr":""}},"successes":{}}
|
@ -1 +1 @@
|
|||||||
{"rustc_fingerprint":14318102787793507742,"outputs":{"15729799797837862367":{"success":true,"status":"","code":0,"stdout":"___\nlib___.rlib\nlib___.dylib\nlib___.dylib\nlib___.a\nlib___.dylib\n/Users/shoofle/.rustup/toolchains/stable-x86_64-apple-darwin\noff\npacked\nunpacked\n___\ndebug_assertions\npanic=\"unwind\"\nproc_macro\ntarget_arch=\"x86_64\"\ntarget_endian=\"little\"\ntarget_env=\"\"\ntarget_family=\"unix\"\ntarget_feature=\"cmpxchg16b\"\ntarget_feature=\"fxsr\"\ntarget_feature=\"sse\"\ntarget_feature=\"sse2\"\ntarget_feature=\"sse3\"\ntarget_feature=\"sse4.1\"\ntarget_feature=\"ssse3\"\ntarget_has_atomic=\"128\"\ntarget_has_atomic=\"16\"\ntarget_has_atomic=\"32\"\ntarget_has_atomic=\"64\"\ntarget_has_atomic=\"8\"\ntarget_has_atomic=\"ptr\"\ntarget_os=\"macos\"\ntarget_pointer_width=\"64\"\ntarget_vendor=\"apple\"\nunix\n","stderr":""},"4614504638168534921":{"success":true,"status":"","code":0,"stdout":"rustc 1.74.1 (a28077b28 2023-12-04)\nbinary: rustc\ncommit-hash: a28077b28a02b92985b3a3faecf92813155f1ea1\ncommit-date: 2023-12-04\nhost: x86_64-apple-darwin\nrelease: 1.74.1\nLLVM version: 17.0.4\n","stderr":""}},"successes":{}}
|
{"rustc_fingerprint":18427324047803895159,"outputs":{"4614504638168534921":{"success":true,"status":"","code":0,"stdout":"rustc 1.74.1 (a28077b28 2023-12-04)\nbinary: rustc\ncommit-hash: a28077b28a02b92985b3a3faecf92813155f1ea1\ncommit-date: 2023-12-04\nhost: x86_64-apple-darwin\nrelease: 1.74.1\nLLVM version: 17.0.4\n","stderr":""},"12285253167677315500":{"success":true,"status":"","code":0,"stdout":"___\nlib___.rlib\nlib___.dylib\nlib___.dylib\nlib___.a\nlib___.dylib\n/Users/shoofle/.rustup/toolchains/stable-x86_64-apple-darwin\noff\npacked\nunpacked\n___\ndebug_assertions\noverflow_checks\npanic=\"unwind\"\nproc_macro\nrelocation_model=\"pic\"\ntarget_abi=\"\"\ntarget_arch=\"x86_64\"\ntarget_endian=\"little\"\ntarget_env=\"\"\ntarget_family=\"unix\"\ntarget_feature=\"cmpxchg16b\"\ntarget_feature=\"fxsr\"\ntarget_feature=\"sse\"\ntarget_feature=\"sse2\"\ntarget_feature=\"sse3\"\ntarget_feature=\"sse4.1\"\ntarget_feature=\"ssse3\"\ntarget_has_atomic\ntarget_has_atomic=\"128\"\ntarget_has_atomic=\"16\"\ntarget_has_atomic=\"32\"\ntarget_has_atomic=\"64\"\ntarget_has_atomic=\"8\"\ntarget_has_atomic=\"ptr\"\ntarget_has_atomic_equal_alignment=\"16\"\ntarget_has_atomic_equal_alignment=\"32\"\ntarget_has_atomic_equal_alignment=\"64\"\ntarget_has_atomic_equal_alignment=\"8\"\ntarget_has_atomic_equal_alignment=\"ptr\"\ntarget_has_atomic_load_store\ntarget_has_atomic_load_store=\"128\"\ntarget_has_atomic_load_store=\"16\"\ntarget_has_atomic_load_store=\"32\"\ntarget_has_atomic_load_store=\"64\"\ntarget_has_atomic_load_store=\"8\"\ntarget_has_atomic_load_store=\"ptr\"\ntarget_os=\"macos\"\ntarget_pointer_width=\"64\"\ntarget_thread_local\ntarget_vendor=\"apple\"\nunix\n","stderr":""}},"successes":{}}
|
8
day21/.idea/.gitignore
vendored
Normal file
8
day21/.idea/.gitignore
vendored
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
# Default ignored files
|
||||||
|
/shelf/
|
||||||
|
/workspace.xml
|
||||||
|
# Editor-based HTTP Client requests
|
||||||
|
/httpRequests/
|
||||||
|
# Datasource local storage ignored files
|
||||||
|
/dataSources/
|
||||||
|
/dataSources.local.xml
|
11
day21/.idea/day21.iml
Normal file
11
day21/.idea/day21.iml
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<module type="EMPTY_MODULE" version="4">
|
||||||
|
<component name="NewModuleRootManager">
|
||||||
|
<content url="file://$MODULE_DIR$">
|
||||||
|
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/target" />
|
||||||
|
</content>
|
||||||
|
<orderEntry type="inheritedJdk" />
|
||||||
|
<orderEntry type="sourceFolder" forTests="false" />
|
||||||
|
</component>
|
||||||
|
</module>
|
8
day21/.idea/modules.xml
Normal file
8
day21/.idea/modules.xml
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="ProjectModuleManager">
|
||||||
|
<modules>
|
||||||
|
<module fileurl="file://$PROJECT_DIR$/.idea/day21.iml" filepath="$PROJECT_DIR$/.idea/day21.iml" />
|
||||||
|
</modules>
|
||||||
|
</component>
|
||||||
|
</project>
|
6
day21/.idea/vcs.xml
Normal file
6
day21/.idea/vcs.xml
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="VcsDirectoryMappings">
|
||||||
|
<mapping directory="$PROJECT_DIR$/.." vcs="Git" />
|
||||||
|
</component>
|
||||||
|
</project>
|
7
day21/Cargo.lock
generated
Normal file
7
day21/Cargo.lock
generated
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
# This file is automatically @generated by Cargo.
|
||||||
|
# It is not intended for manual editing.
|
||||||
|
version = 3
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "day21"
|
||||||
|
version = "0.1.0"
|
8
day21/Cargo.toml
Normal file
8
day21/Cargo.toml
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
[package]
|
||||||
|
name = "day21"
|
||||||
|
version = "0.1.0"
|
||||||
|
edition = "2021"
|
||||||
|
|
||||||
|
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||||
|
|
||||||
|
[dependencies]
|
29
day21/drawings
Normal file
29
day21/drawings
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
.^.
|
||||||
|
<#>
|
||||||
|
.v.
|
||||||
|
points + #
|
||||||
|
|
||||||
|
# = 7596
|
||||||
|
points + # = 34324
|
||||||
|
|
||||||
|
..^..
|
||||||
|
./#\.
|
||||||
|
<#@#>
|
||||||
|
.\#/.
|
||||||
|
..v..
|
||||||
|
|
||||||
|
...^...
|
||||||
|
../#\..
|
||||||
|
./#@#\.
|
||||||
|
<#@#@#>
|
||||||
|
.\#@#/.
|
||||||
|
..\#/..
|
||||||
|
...v...
|
||||||
|
|
||||||
|
<+^+v+> +2\+2\+2/+2/+9#+4@
|
||||||
|
|
||||||
|
<+^+v+>+\+\+/+/+4*#+@
|
||||||
|
|
||||||
|
65 => x
|
||||||
|
131+65 => <x>
|
||||||
|
262+6
|
90
day21/src/main.rs
Normal file
90
day21/src/main.rs
Normal file
@ -0,0 +1,90 @@
|
|||||||
|
use std::collections::HashSet;
|
||||||
|
use std::fs;
|
||||||
|
use std::env;
|
||||||
|
use crate::Dir::{Up, Down, Right, Left};
|
||||||
|
|
||||||
|
// THIS IS NOT A PLACE OF HONOR
|
||||||
|
|
||||||
|
type Coord = (i64, i64);
|
||||||
|
|
||||||
|
fn step(start: &Coord, d: &Dir, steps: i64) -> Coord {
|
||||||
|
match d {
|
||||||
|
Up => (start.0, start.1 - steps),
|
||||||
|
Down => (start.0, start.1 + steps),
|
||||||
|
Right => (start.0 + steps, start.1),
|
||||||
|
Left => (start.0 - steps, start.1),
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
fn neighbors(here: &Coord) -> HashSet<Coord> {
|
||||||
|
return HashSet::from([
|
||||||
|
step(here, &Up, 1), step(here, &Down, 1),
|
||||||
|
step(here, &Left, 1), step(here, &Right, 1)
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
|
fn is_floor(here: &Coord, floors: &HashSet<Coord>, corner: &Coord) -> bool {
|
||||||
|
let here2: Coord = ((here.0 % corner.0 + corner.0) % corner.0,
|
||||||
|
(here.1 % corner.1 + corner.1) % corner.1);
|
||||||
|
return floors.contains(&here2);
|
||||||
|
}
|
||||||
|
|
||||||
|
#[derive(Clone, Copy, PartialEq, Eq, Hash, Debug)]
|
||||||
|
enum Dir { Up, Down, Left, Right }
|
||||||
|
|
||||||
|
fn main() {
|
||||||
|
println!("Hello, AoC day 21!");
|
||||||
|
|
||||||
|
let args: Vec<String> = env::args().collect();
|
||||||
|
if args.len() != 2 {
|
||||||
|
println!("wrong number of arguments!");
|
||||||
|
std::process::exit(1);
|
||||||
|
}
|
||||||
|
|
||||||
|
let file_path = &args[1];
|
||||||
|
|
||||||
|
let contents = fs::read_to_string(file_path).expect("Should have been able to read the file");
|
||||||
|
|
||||||
|
// build our grid!
|
||||||
|
let mut floors: HashSet<Coord> = HashSet::new();
|
||||||
|
let mut y = 0;
|
||||||
|
let mut x = 0;
|
||||||
|
let mut start = (-2, -2);
|
||||||
|
for line in contents.lines() {
|
||||||
|
x = 0;
|
||||||
|
for c in line.chars() {
|
||||||
|
if c == '.' || c == 'S' { floors.insert((x,y)); }
|
||||||
|
if c == 'S' { start = (x,y);}
|
||||||
|
x += 1;
|
||||||
|
}
|
||||||
|
y += 1;
|
||||||
|
}
|
||||||
|
let corner = (x,y);
|
||||||
|
|
||||||
|
let mut evens: HashSet<Coord> = HashSet::new();
|
||||||
|
let mut odds: HashSet<Coord> = HashSet::new();
|
||||||
|
let mut wavefront = HashSet::from([start]);
|
||||||
|
let iterations = 65+262+262+262 + 262+262;
|
||||||
|
for i in 0..iterations {
|
||||||
|
if i%2 == 0 {
|
||||||
|
evens.extend(&wavefront);
|
||||||
|
} else {
|
||||||
|
odds.extend(&wavefront);
|
||||||
|
}
|
||||||
|
wavefront = wavefront.iter()
|
||||||
|
.flat_map(|x| neighbors(x))
|
||||||
|
.filter(|x| is_floor(x, &floors, &corner))
|
||||||
|
.filter(|x| !evens.contains(x))
|
||||||
|
.filter(|x| !odds.contains(x))
|
||||||
|
.collect();
|
||||||
|
}
|
||||||
|
let count;
|
||||||
|
if iterations%2 == 0 {
|
||||||
|
count = wavefront.len() + evens.len();
|
||||||
|
} else {
|
||||||
|
count = wavefront.len() + odds.len();
|
||||||
|
}
|
||||||
|
|
||||||
|
println!("today's grid is {}x{}", corner.0, corner.1);
|
||||||
|
println!("The total number of spaces visitable after {iterations} steps is {count} with a wavefront of {}", wavefront.len());
|
||||||
|
}
|
1
day21/target/.rustc_info.json
Normal file
1
day21/target/.rustc_info.json
Normal file
@ -0,0 +1 @@
|
|||||||
|
{"rustc_fingerprint":14318102787793507742,"outputs":{"4614504638168534921":{"success":true,"status":"","code":0,"stdout":"rustc 1.74.1 (a28077b28 2023-12-04)\nbinary: rustc\ncommit-hash: a28077b28a02b92985b3a3faecf92813155f1ea1\ncommit-date: 2023-12-04\nhost: x86_64-apple-darwin\nrelease: 1.74.1\nLLVM version: 17.0.4\n","stderr":""},"15729799797837862367":{"success":true,"status":"","code":0,"stdout":"___\nlib___.rlib\nlib___.dylib\nlib___.dylib\nlib___.a\nlib___.dylib\n/Users/shoofle/.rustup/toolchains/stable-x86_64-apple-darwin\noff\npacked\nunpacked\n___\ndebug_assertions\npanic=\"unwind\"\nproc_macro\ntarget_arch=\"x86_64\"\ntarget_endian=\"little\"\ntarget_env=\"\"\ntarget_family=\"unix\"\ntarget_feature=\"cmpxchg16b\"\ntarget_feature=\"fxsr\"\ntarget_feature=\"sse\"\ntarget_feature=\"sse2\"\ntarget_feature=\"sse3\"\ntarget_feature=\"sse4.1\"\ntarget_feature=\"ssse3\"\ntarget_has_atomic=\"128\"\ntarget_has_atomic=\"16\"\ntarget_has_atomic=\"32\"\ntarget_has_atomic=\"64\"\ntarget_has_atomic=\"8\"\ntarget_has_atomic=\"ptr\"\ntarget_os=\"macos\"\ntarget_pointer_width=\"64\"\ntarget_vendor=\"apple\"\nunix\n","stderr":""}},"successes":{}}
|
3
day21/target/CACHEDIR.TAG
Normal file
3
day21/target/CACHEDIR.TAG
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
Signature: 8a477f597d28d172789f06886806bc55
|
||||||
|
# This file is a cache directory tag created by cargo.
|
||||||
|
# For information about cache directory tags see https://bford.info/cachedir/
|
@ -0,0 +1 @@
|
|||||||
|
965bff28ed275a60
|
@ -0,0 +1 @@
|
|||||||
|
{"rustc":4443399816165520464,"features":"[]","target":3944935762996468705,"profile":237655285757591511,"path":1684066648322511884,"deps":[],"local":[{"CheckDepInfo":{"dep_info":"debug/.fingerprint/day21-4366a4b2280a9166/dep-bin-day21"}}],"rustflags":[],"metadata":7797948686568424061,"config":2202906307356721367,"compile_kind":0}
|
Binary file not shown.
@ -0,0 +1 @@
|
|||||||
|
This file has an mtime of when this was started.
|
@ -0,0 +1 @@
|
|||||||
|
da02856354db06f9
|
@ -0,0 +1 @@
|
|||||||
|
{"rustc":4443399816165520464,"features":"[]","target":3944935762996468705,"profile":13396965805329499462,"path":1684066648322511884,"deps":[],"local":[{"CheckDepInfo":{"dep_info":"debug/.fingerprint/day21-aa9d24052146d0b2/dep-bin-day21"}}],"rustflags":[],"metadata":7797948686568424061,"config":2202906307356721367,"compile_kind":0}
|
@ -0,0 +1 @@
|
|||||||
|
This file has an mtime of when this was started.
|
@ -0,0 +1 @@
|
|||||||
|
This file has an mtime of when this was started.
|
@ -0,0 +1 @@
|
|||||||
|
2a70ec3b74cefa07
|
@ -0,0 +1 @@
|
|||||||
|
{"rustc":4443399816165520464,"features":"[]","target":3944935762996468705,"profile":13053956386274884697,"path":1684066648322511884,"deps":[],"local":[{"CheckDepInfo":{"dep_info":"debug/.fingerprint/day21-f3c759690b3a77a6/dep-test-bin-day21"}}],"rustflags":[],"metadata":7797948686568424061,"config":2202906307356721367,"compile_kind":0}
|
BIN
day21/target/debug/day21
Executable file
BIN
day21/target/debug/day21
Executable file
Binary file not shown.
1
day21/target/debug/day21.d
Normal file
1
day21/target/debug/day21.d
Normal file
@ -0,0 +1 @@
|
|||||||
|
/Users/shoofle/Projects/aoc_2023/day21/target/debug/day21: /Users/shoofle/Projects/aoc_2023/day21/src/main.rs
|
BIN
day21/target/debug/deps/day21-4366a4b2280a9166
Executable file
BIN
day21/target/debug/deps/day21-4366a4b2280a9166
Executable file
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user