summaryrefslogtreecommitdiff
path: root/aoc18
diff options
context:
space:
mode:
Diffstat (limited to 'aoc18')
-rw-r--r--aoc18/Cargo.lock4
-rw-r--r--aoc18/Cargo.toml6
-rw-r--r--aoc18/src/main.rs20
3 files changed, 0 insertions, 30 deletions
diff --git a/aoc18/Cargo.lock b/aoc18/Cargo.lock
deleted file mode 100644
index d26659d..0000000
--- a/aoc18/Cargo.lock
+++ /dev/null
@@ -1,4 +0,0 @@
-[root]
-name = "aoc18"
-version = "0.1.0"
-
diff --git a/aoc18/Cargo.toml b/aoc18/Cargo.toml
deleted file mode 100644
index 5eadfea..0000000
--- a/aoc18/Cargo.toml
+++ /dev/null
@@ -1,6 +0,0 @@
-[package]
-name = "aoc18"
-version = "0.1.0"
-authors = ["Justin Worthe <justin.worthe@gmail.com>"]
-
-[dependencies]
diff --git a/aoc18/src/main.rs b/aoc18/src/main.rs
deleted file mode 100644
index 52ad7a9..0000000
--- a/aoc18/src/main.rs
+++ /dev/null
@@ -1,20 +0,0 @@
-fn main() {
- let init: Vec<char> = ".^^..^...^..^^.^^^.^^^.^^^^^^.^.^^^^.^^.^^^^^^.^...^......^...^^^..^^^.....^^^^^^^^^....^^...^^^^..^".chars().collect();
-
- let mut map = Vec::new();
- map.push(init);
-
- for _ in 1..400000 {
- let last = map.last().unwrap().clone();
- let mut next = Vec::new();
- for i in 0..last.len() {
- let left = if i == 0 { '.' } else { last[i-1] };
- let right = if i == last.len()-1 { '.' } else { last[i+1] };
- next.push(if left == right { '.' } else { '^' });
- }
- map.push(next);
- }
-
- let safe_count = map.iter().map(|row| row.iter().filter(|&&c| c=='.').count() as u32).sum::<u32>();
- println!("Safe tiles: {}", safe_count);
-}