Linter cleanups
This commit is contained in:
parent
a2b4066618
commit
f4c64f39c4
|
@ -74,7 +74,7 @@ fn main() -> Result<(), Box<dyn Error>> {
|
|||
let file = File::open("inputs/day14.txt")?;
|
||||
let mut lines = io::BufReader::new(file).lines();
|
||||
|
||||
let mut polymer_template: Vec<char> = lines.next().unwrap().unwrap().chars().collect();
|
||||
let polymer_template: Vec<char> = lines.next().unwrap().unwrap().chars().collect();
|
||||
lines.next();
|
||||
|
||||
let mut rules: HashMap<(char, char), char> = HashMap::new();
|
||||
|
|
|
@ -1,7 +1,3 @@
|
|||
use std::cmp::Ordering;
|
||||
use std::collections::BinaryHeap;
|
||||
use std::collections::HashMap;
|
||||
use std::collections::HashSet;
|
||||
use std::error::Error;
|
||||
use std::fs::File;
|
||||
use std::io::{self, BufRead};
|
||||
|
|
|
@ -1,11 +1,6 @@
|
|||
use std::cmp::Ordering;
|
||||
use std::collections::BinaryHeap;
|
||||
use std::collections::HashMap;
|
||||
use std::collections::HashSet;
|
||||
use std::error::Error;
|
||||
use std::fs::File;
|
||||
use std::io::{self, BufRead};
|
||||
use std::vec::Vec;
|
||||
|
||||
#[macro_use]
|
||||
extern crate lazy_static;
|
||||
|
@ -35,7 +30,11 @@ fn is_hit(
|
|||
}
|
||||
|
||||
if vx != 0 {
|
||||
vx -= 1;
|
||||
if vx > 0 {
|
||||
vx -= 1;
|
||||
} else {
|
||||
vx += 1;
|
||||
}
|
||||
}
|
||||
vy -= 1;
|
||||
|
||||
|
@ -90,7 +89,7 @@ fn main() -> Result<(), Box<dyn Error>> {
|
|||
|
||||
let mut hits = 0;
|
||||
|
||||
for vx in -256..256 {
|
||||
for vx in 0..256 {
|
||||
for vy in -256..246 {
|
||||
let (hit, local_max_y) = is_hit(vx, vy, target.0, target.1, target.2, target.3);
|
||||
if hit {
|
||||
|
|
Loading…
Reference in New Issue