day 23
This commit is contained in:
parent
921e2aaef6
commit
9773bf6cce
7
d23/Cargo.lock
generated
Normal file
7
d23/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 = "d05"
|
||||||
|
version = "0.1.0"
|
@ -0,0 +1,71 @@
|
|||||||
|
...###.....#.#....##....#..###.....#.##.#..####..#.##.....##..#####..##
|
||||||
|
#..##....#####...#.#.#############...#.######.#.##.##...####.#.#.#.#.##
|
||||||
|
.#..###..#..#......#..#####.....#.###..##.###.#.##..##...#.#.###.#...##
|
||||||
|
#.####..#..#.##...####.##.#..##..#.#.#..#..#.......#....###...######.##
|
||||||
|
..###....#...###..###...##..##.##..#.#.......#.#...########..#.##...#.#
|
||||||
|
##.....#.#....##.......#..#.#.#.##..###..#.##.##.##....#..#........#...
|
||||||
|
#.#...####...#.#.##.#.##....#####.#########.####..#.#.######...#.......
|
||||||
|
###..##..#.#..#..##.#..#..##.#.............#...##.#..##..###....#.##.#.
|
||||||
|
##.##....#..#.##.....#..#.#.#..###.#.#..##.#.##....##.#...##########...
|
||||||
|
...#...####.#...#...#.#....##..#.....#.#...##..##.#.#...#..##.#..###..#
|
||||||
|
.#####.##.#.#.##...###.#.#....##..#...###..##..#.##...#.#.###..##..##..
|
||||||
|
#.#.#.###.#.#.#.##..##.#.#....##.##.####...#..###..#..##.#####....##.#.
|
||||||
|
.#.##.#####...###..###.#..#.##.......#...#.#...#...#..#.#.#.#....#.##.#
|
||||||
|
#.#.##..###....####.#..#.....#..##.#####..##.....#.###.#..###.######.#.
|
||||||
|
..#..#..#..##.##.#.####.#....#.#.#.###..#..#.#.#..#..##..#.###..####..#
|
||||||
|
#.#....#.#.#.#....###....###..###...##.#####.##..#.##..####.#...##.##.#
|
||||||
|
...#...#....#..####..#.#..##..#..#.###.####.#.#.#.#..#.###.#.##...###.#
|
||||||
|
....#..#.#.###..#...#..#..##.....##...#...##..#.#.###.#.#...###..#..#..
|
||||||
|
.##....#.#.##.#...#.#....##......####..##.#########......###..###.#...#
|
||||||
|
#..#..#.###.##..#..##.#...###..###.#....##...#.#.#.#..#..####.###.#...#
|
||||||
|
.#..#.#.#...#.#.##.##..#.#...#.#.####..#..#.##.#....#..##..#.#...#.##.#
|
||||||
|
#......##.#.#...#.##..####..#.##...####.#.....######.##..##.#....##.#.#
|
||||||
|
#.##.#..####.#.###.#......###.#..##.##.#..#######.####..#.#.##.##.#.#..
|
||||||
|
#######.##.###.#..#.......#.#...#....#.##.###..#...#.####.....###..####
|
||||||
|
....#.#.#.##.....###.....##..####..#.#...####..####.#...##..###.##.....
|
||||||
|
.#.#...#..#......#..#...#####....#....###.##.#...####..#.#.###.##.##..#
|
||||||
|
.#.##.#.#.#.#.#.#.#.#...##.##.##.#......##.###..#####.#.#......###....#
|
||||||
|
..##..####.###..##.#.#...#..##.####.###...###...###..#.#.###...#.....##
|
||||||
|
.##..#.####.####.#...###.##....#.##.######..####.##.#...#..#...##.#.##.
|
||||||
|
.##.####.......#..#.##.#...##......##.##...#...###..#.#.#..#..###.....#
|
||||||
|
#####....##.##.#..####...##..##..###..#.#..#.#.#.###.#...#..#...###.#..
|
||||||
|
##.#..#.#.#..#..###...##..####..#.#.#.#.#.##.####.##.##.####..#...#...#
|
||||||
|
.#.#.#..#.###.#.##.......#.##..#..###......#..#.#..##.###..#.##.##.###.
|
||||||
|
.##...###....#.#.......#..#######...#.##.#..###.###.#.#..#..#.##..##.#.
|
||||||
|
.##..###.#....#.###.#####.##..##...##.#..######...#..##..###...#.##....
|
||||||
|
#...##.#..#..#..#......###..#...#####.#..#.####.#...#.#.###..#.###.#...
|
||||||
|
.####.#####.#..#.####.#...###.###.#.#.###.#..#.###.#.#####..#....#..##.
|
||||||
|
#..###.#.#..#....##...##.....###.##.##.#.##.###..####..#.#######.##.###
|
||||||
|
.#.#...##...####.###....#.###..##.#.#.#####...#####..#..#....###.#.##.#
|
||||||
|
##.##.###..####..###.....##.#...###...##.#...#..#.#.####..#...#.#.#.##.
|
||||||
|
##.....#....####...##.##...#.#..#.#.###.#......#...#.###.#..##..#......
|
||||||
|
###.###.####.......######..#..##.#....#...##..##......######.#.#.###.##
|
||||||
|
#...#.#..##.####...#.#...#.#.#.....#..######..#...#.##..##...##.#...#..
|
||||||
|
.#####......#..##.....#....#.####...##...###.#.##.#.#..#.#...#.###.##.#
|
||||||
|
.#..#####.#....#.##.#..###.....###..#.####.####.#..#.###...##....####.#
|
||||||
|
###..#..###.#..#.#.#.########.#.##..##..###..#.##.#.......#.......###..
|
||||||
|
###....##...##.##.#.#.###.####.........#...#.#.......#..#######...#.#..
|
||||||
|
#....#####.#.##.####.#......#.##..#.#.##...###..#.##.##.##.##..###.####
|
||||||
|
...#..##..#.###..###.##.#.##..###..#####.####.#.###.#.###..##.#.###....
|
||||||
|
...#.#.##.####..#.######.#......##.#.....###.#.#...#.#.##.##..##.#....#
|
||||||
|
##...####....#######.#.#.#..##.#.#.####.##.###........#.#.##...##.....#
|
||||||
|
###...#.........###...#.##.###..##########..#####...#......#....###.##.
|
||||||
|
#..#...####.##.....#..##..#....#.##..##.#..###..#..##..#.###.#..##...#.
|
||||||
|
.###..######.#.#######.####.#.#..#.#..##.#.#.###.##..##.#..#.#.####....
|
||||||
|
#...#.###....##.#..##.....#..########...#...#..###.#.#.#......#.#.###..
|
||||||
|
..###...#..#.##.....####.####..###..#...##.##...##....##.#..#.....#.#..
|
||||||
|
..#.####..#....##....##.###.#.###.##..##.##...##...######....##..###.##
|
||||||
|
....#...#..#.....###.####..#######..#.##...#...##..#...##..#.#.#...####
|
||||||
|
###...##.#.##.######....#.#.#.#.....#.##.###..#..#.#.#..####.#....#..##
|
||||||
|
##.#.#.###.###...###.######.#...#.#...#..#.#...###.#.##.##..##.#..###..
|
||||||
|
#...######.##..##...#.###...##..#.#...##.###.#..####....###..#..#......
|
||||||
|
.#.#.###.#..#.#..##....##..#.#..#.#...####.#..####....#.##..####.##.#.#
|
||||||
|
.##..##...#..#.###.....#.....##.##..#.#..######.######...##.###..#..##.
|
||||||
|
.#..##.####.#####..###..#...#.##.#.....#.#..##...###..#..#..#####.####.
|
||||||
|
#.##..##...##.#.#.#..#..#..##.###.#.##..#..##.#..##.###..#.....###.#...
|
||||||
|
.##.#.##.##.###.##.##...#.##..#.####..###.#....##..###..#.###.#....####
|
||||||
|
.######.##.#..#.....#...#.....###..#...##..##.##.#.....#.##.....#.#.##.
|
||||||
|
#.....##....#.#..##...#.#.##.##...##....###.#...#####.#.#.#......###.##
|
||||||
|
..#.#..#...#..##.##.#..####..#..###..#####......##.....##.#.#..#....##.
|
||||||
|
#.#....#.##..##.#...#.##.#..#.##...###..####.##..##...###.....#.##..#..
|
||||||
|
##.#.###...##.#..#.....##.#..#.#..##..#..#.###.#.#.######..#.#....##..#
|
321
d23/src/a1.rs
321
d23/src/a1.rs
@ -1,4 +1,325 @@
|
|||||||
|
use std::collections::HashSet;
|
||||||
|
|
||||||
|
|
||||||
|
#[derive(Hash, PartialOrd, Ord, Eq, Clone, Copy)]
|
||||||
|
struct Elve {
|
||||||
|
pos :Pos,
|
||||||
|
future_pos :Option<Pos>,
|
||||||
|
}
|
||||||
|
|
||||||
|
impl Elve {
|
||||||
|
fn from(x :i32, y :i32) -> Self {
|
||||||
|
Elve {
|
||||||
|
pos: Pos::from(x, y),
|
||||||
|
future_pos: None,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
impl PartialEq for Elve {
|
||||||
|
fn eq(&self, other :&Elve) -> bool {
|
||||||
|
self.pos.eq(&other.pos)
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#[derive(Hash, PartialEq, PartialOrd, Ord, Eq, Clone, Copy)]
|
||||||
|
struct Pos {
|
||||||
|
x :i32,
|
||||||
|
y :i32,
|
||||||
|
}
|
||||||
|
|
||||||
|
impl Pos {
|
||||||
|
fn from(x :i32, y :i32) -> Self {
|
||||||
|
Pos { x: x, y: y }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
enum Direction {
|
||||||
|
NORTH,
|
||||||
|
SOUTH,
|
||||||
|
EAST,
|
||||||
|
WEST,
|
||||||
|
}
|
||||||
|
|
||||||
|
fn parse_input(inp :Vec<String>) -> Vec<Elve> {
|
||||||
|
let mut map = Vec::new();
|
||||||
|
|
||||||
|
for l in inp.iter().enumerate() {
|
||||||
|
|
||||||
|
for c in l.1.chars().enumerate() {
|
||||||
|
if c.1 == '#' {
|
||||||
|
map.push(Elve::from(c.0 as i32, l.0 as i32));
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
map
|
||||||
|
}
|
||||||
|
|
||||||
|
fn has_neighbours(elves :&Vec<Elve>, cp :&Pos) -> bool {
|
||||||
|
|
||||||
|
if elves.contains(&Elve::from(cp.x - 1, cp.y)) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
if elves.contains(&Elve::from(cp.x + 1, cp.y)) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
for i in 0..3 {
|
||||||
|
if elves.contains(&Elve::from(cp.x - 1 + i, cp.y - 1)) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if elves.contains(&Elve::from(cp.x - 1 + i, cp.y + 1)) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
false
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
fn calculate_future_pos(elves :&Vec<Elve>, i :usize, directions :&Vec<Direction>, current_dir :usize) -> Pos {
|
||||||
|
|
||||||
|
let cp = elves[i].pos;
|
||||||
|
|
||||||
|
|
||||||
|
// check if elve has any neighbors
|
||||||
|
if !has_neighbours(elves, &cp) {
|
||||||
|
return cp;
|
||||||
|
}
|
||||||
|
|
||||||
|
let mut i = current_dir;
|
||||||
|
for _ in 0..directions.len() {
|
||||||
|
|
||||||
|
|
||||||
|
let (p1, p2, p3) = match directions[i] {
|
||||||
|
Direction::NORTH => {
|
||||||
|
let p1 = Pos::from(cp.x - 1, cp.y - 1);
|
||||||
|
let p2 = Pos::from(cp.x, cp.y - 1);
|
||||||
|
let p3 = Pos::from(cp.x + 1, cp.y - 1);
|
||||||
|
|
||||||
|
(p1, p2, p3)
|
||||||
|
}
|
||||||
|
|
||||||
|
Direction::SOUTH => {
|
||||||
|
|
||||||
|
let p1 = Pos::from(cp.x - 1, cp.y + 1);
|
||||||
|
let p2 = Pos::from(cp.x, cp.y + 1);
|
||||||
|
let p3 = Pos::from(cp.x + 1, cp.y + 1);
|
||||||
|
|
||||||
|
(p1, p2, p3)
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
Direction::EAST => {
|
||||||
|
let p1 = Pos::from(cp.x + 1, cp.y - 1);
|
||||||
|
let p2 = Pos::from(cp.x + 1, cp.y);
|
||||||
|
let p3 = Pos::from(cp.x + 1, cp.y + 1);
|
||||||
|
|
||||||
|
(p1, p2, p3)
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
Direction::WEST => {
|
||||||
|
|
||||||
|
let p1 = Pos::from(cp.x - 1, cp.y - 1);
|
||||||
|
let p2 = Pos::from(cp.x - 1, cp.y);
|
||||||
|
let p3 = Pos::from(cp.x - 1, cp.y + 1);
|
||||||
|
|
||||||
|
(p1, p2, p3)
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
//println!("checked {} for ({}, {})", i, cp.x, cp.y);
|
||||||
|
|
||||||
|
if !(elves.contains(&Elve::from(p1.x, p1.y)) || elves.contains(&Elve::from(p2.x, p2.y)) || elves.contains(&Elve::from(p3.x, p3.y))) {
|
||||||
|
|
||||||
|
//println!("({}, {}) wants to go to ({}, {})", cp.x, cp.y, p2.x, p2.y);
|
||||||
|
|
||||||
|
return p2;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
i = (i + 1) % directions.len();
|
||||||
|
}
|
||||||
|
|
||||||
|
//println!("({}, {}) had no valid position", cp.x, cp.y);
|
||||||
|
cp
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
fn simulate_round(elves :&mut Vec<Elve>, directions :&Vec<Direction>, current_dir :usize) {
|
||||||
|
|
||||||
|
// go throug the directions for every elve & pick the first fitting
|
||||||
|
for i in 0..elves.len() {
|
||||||
|
let future_pos = calculate_future_pos(elves, i, directions, current_dir);
|
||||||
|
elves[i].future_pos = Some(future_pos);
|
||||||
|
}
|
||||||
|
|
||||||
|
// look throug all elves and check if there are repeating positions
|
||||||
|
let mut duplicates = Vec::new();
|
||||||
|
let mut save = HashSet::new();
|
||||||
|
|
||||||
|
for i in 0..elves.len() {
|
||||||
|
|
||||||
|
match elves[i].future_pos {
|
||||||
|
Some(s) => {
|
||||||
|
|
||||||
|
|
||||||
|
if save.contains(&s) {
|
||||||
|
duplicates.push(s);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
save.insert(s);
|
||||||
|
}
|
||||||
|
|
||||||
|
None => {}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// remove duplicate positions
|
||||||
|
for p in duplicates {
|
||||||
|
for i in 0..elves.len() {
|
||||||
|
|
||||||
|
match elves[i].future_pos {
|
||||||
|
Some (s) => {
|
||||||
|
|
||||||
|
if s.eq(&p) {
|
||||||
|
//println!("Collided: ({}, {})", p.x, p.y);
|
||||||
|
elves[i].future_pos = None;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
None => {}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// move elves with future_pos to future_pos
|
||||||
|
for elve in elves {
|
||||||
|
match elve.future_pos {
|
||||||
|
Some(s) => {
|
||||||
|
elve.pos = s;
|
||||||
|
}
|
||||||
|
None => {}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
fn find_borders(elves :&Vec<Elve>) -> (Pos, Pos) {
|
||||||
|
let mut min = Pos::from(i32::MAX, i32::MAX);
|
||||||
|
let mut max = Pos::from(i32::MIN, i32::MIN);
|
||||||
|
|
||||||
|
for elve in elves {
|
||||||
|
if elve.pos.x > max.x {
|
||||||
|
max.x = elve.pos.x;
|
||||||
|
}
|
||||||
|
|
||||||
|
if elve.pos.y > max.y {
|
||||||
|
max.y = elve.pos.y;
|
||||||
|
}
|
||||||
|
|
||||||
|
if elve.pos.x < min.x {
|
||||||
|
min.x = elve.pos.x;
|
||||||
|
}
|
||||||
|
|
||||||
|
if elve.pos.y < min.y {
|
||||||
|
min.y = elve.pos.y;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
(min, max)
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
fn print_board(elves :&Vec<Elve>, mut min :Pos, mut max :Pos) {
|
||||||
|
|
||||||
|
if max.y < 0 || max.x < 0 {
|
||||||
|
println!("Fuck");
|
||||||
|
std::process::exit(1);
|
||||||
|
}
|
||||||
|
|
||||||
|
let mut y_off = 0;
|
||||||
|
let mut x_off = 0;
|
||||||
|
|
||||||
|
if min.y < 0 {
|
||||||
|
y_off = min.y.abs();
|
||||||
|
min.y = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
if min.x < 0 {
|
||||||
|
x_off = min.x.abs();
|
||||||
|
min.x = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
let mut map = vec![vec!['.'; (max.x - min.x + x_off + 1) as usize]; (max.y - min.y + y_off + 1) as usize];
|
||||||
|
|
||||||
|
for e in elves {
|
||||||
|
map[(e.pos.y - min.y + y_off) as usize][(e.pos.x - min.x + x_off) as usize] = '#';
|
||||||
|
}
|
||||||
|
|
||||||
|
for l in map {
|
||||||
|
for c in l {
|
||||||
|
print!("{}", c);
|
||||||
|
}
|
||||||
|
println!();
|
||||||
|
}
|
||||||
|
println!();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
pub fn run(inp :Vec<String>) {
|
pub fn run(inp :Vec<String>) {
|
||||||
|
let mut elves = parse_input(inp);
|
||||||
|
|
||||||
|
let mut current_direction = 0; // cycles through 0..3
|
||||||
|
|
||||||
|
let directions = vec![
|
||||||
|
Direction::NORTH,
|
||||||
|
Direction::SOUTH,
|
||||||
|
Direction::WEST,
|
||||||
|
Direction::EAST,
|
||||||
|
];
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
for i in 0..10 {
|
||||||
|
//let (min, max) = find_borders(&elves);
|
||||||
|
|
||||||
|
|
||||||
|
//println!();
|
||||||
|
//println!("{}: ", i);
|
||||||
|
//print_board(&elves, min, max);
|
||||||
|
|
||||||
|
|
||||||
|
simulate_round(&mut elves, &directions, current_direction);
|
||||||
|
current_direction = (current_direction + 1) % directions.len();
|
||||||
|
}
|
||||||
|
|
||||||
|
let (min, max) = find_borders(&elves);
|
||||||
|
|
||||||
|
let mut counter = 0;
|
||||||
|
|
||||||
|
for x in min.x..=max.x {
|
||||||
|
for y in min.y..=max.y {
|
||||||
|
if !elves.contains(&Elve::from(x, y)) {
|
||||||
|
counter += 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
print_board(&elves, min, max);
|
||||||
|
|
||||||
|
println!("a1: {}", counter);
|
||||||
|
|
||||||
}
|
}
|
327
d23/src/a2.rs
327
d23/src/a2.rs
@ -1,5 +1,332 @@
|
|||||||
|
use std::collections::HashSet;
|
||||||
|
|
||||||
|
|
||||||
|
#[derive(Hash, PartialOrd, Ord, Eq, Clone, Copy)]
|
||||||
|
struct Elve {
|
||||||
|
pos :Pos,
|
||||||
|
future_pos :Option<Pos>,
|
||||||
|
}
|
||||||
|
|
||||||
|
impl Elve {
|
||||||
|
fn from(x :i32, y :i32) -> Self {
|
||||||
|
Elve {
|
||||||
|
pos: Pos::from(x, y),
|
||||||
|
future_pos: None,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
impl PartialEq for Elve {
|
||||||
|
fn eq(&self, other :&Elve) -> bool {
|
||||||
|
self.pos.eq(&other.pos)
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#[derive(Hash, PartialEq, PartialOrd, Ord, Eq, Clone, Copy)]
|
||||||
|
struct Pos {
|
||||||
|
x :i32,
|
||||||
|
y :i32,
|
||||||
|
}
|
||||||
|
|
||||||
|
impl Pos {
|
||||||
|
fn from(x :i32, y :i32) -> Self {
|
||||||
|
Pos { x: x, y: y }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
enum Direction {
|
||||||
|
NORTH,
|
||||||
|
SOUTH,
|
||||||
|
EAST,
|
||||||
|
WEST,
|
||||||
|
}
|
||||||
|
|
||||||
|
fn parse_input(inp :Vec<String>) -> Vec<Elve> {
|
||||||
|
let mut map = Vec::new();
|
||||||
|
|
||||||
|
for l in inp.iter().enumerate() {
|
||||||
|
|
||||||
|
for c in l.1.chars().enumerate() {
|
||||||
|
if c.1 == '#' {
|
||||||
|
map.push(Elve::from(c.0 as i32, l.0 as i32));
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
map
|
||||||
|
}
|
||||||
|
|
||||||
|
fn has_neighbours(elves :&Vec<Elve>, cp :&Pos) -> bool {
|
||||||
|
|
||||||
|
if elves.contains(&Elve::from(cp.x - 1, cp.y)) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
if elves.contains(&Elve::from(cp.x + 1, cp.y)) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
for i in 0..3 {
|
||||||
|
if elves.contains(&Elve::from(cp.x - 1 + i, cp.y - 1)) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if elves.contains(&Elve::from(cp.x - 1 + i, cp.y + 1)) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
false
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
fn calculate_future_pos(elves :&Vec<Elve>, i :usize, directions :&Vec<Direction>, current_dir :usize) -> Option<Pos> {
|
||||||
|
|
||||||
|
let cp = elves[i].pos;
|
||||||
|
|
||||||
|
|
||||||
|
// check if elve has any neighbors
|
||||||
|
if !has_neighbours(elves, &cp) {
|
||||||
|
return None;
|
||||||
|
}
|
||||||
|
|
||||||
|
let mut i = current_dir;
|
||||||
|
for _ in 0..directions.len() {
|
||||||
|
|
||||||
|
|
||||||
|
let (p1, p2, p3) = match directions[i] {
|
||||||
|
Direction::NORTH => {
|
||||||
|
let p1 = Pos::from(cp.x - 1, cp.y - 1);
|
||||||
|
let p2 = Pos::from(cp.x, cp.y - 1);
|
||||||
|
let p3 = Pos::from(cp.x + 1, cp.y - 1);
|
||||||
|
|
||||||
|
(p1, p2, p3)
|
||||||
|
}
|
||||||
|
|
||||||
|
Direction::SOUTH => {
|
||||||
|
|
||||||
|
let p1 = Pos::from(cp.x - 1, cp.y + 1);
|
||||||
|
let p2 = Pos::from(cp.x, cp.y + 1);
|
||||||
|
let p3 = Pos::from(cp.x + 1, cp.y + 1);
|
||||||
|
|
||||||
|
(p1, p2, p3)
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
Direction::EAST => {
|
||||||
|
let p1 = Pos::from(cp.x + 1, cp.y - 1);
|
||||||
|
let p2 = Pos::from(cp.x + 1, cp.y);
|
||||||
|
let p3 = Pos::from(cp.x + 1, cp.y + 1);
|
||||||
|
|
||||||
|
(p1, p2, p3)
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
Direction::WEST => {
|
||||||
|
|
||||||
|
let p1 = Pos::from(cp.x - 1, cp.y - 1);
|
||||||
|
let p2 = Pos::from(cp.x - 1, cp.y);
|
||||||
|
let p3 = Pos::from(cp.x - 1, cp.y + 1);
|
||||||
|
|
||||||
|
(p1, p2, p3)
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
//println!("checked {} for ({}, {})", i, cp.x, cp.y);
|
||||||
|
|
||||||
|
if !(elves.contains(&Elve::from(p1.x, p1.y)) || elves.contains(&Elve::from(p2.x, p2.y)) || elves.contains(&Elve::from(p3.x, p3.y))) {
|
||||||
|
|
||||||
|
//println!("({}, {}) wants to go to ({}, {})", cp.x, cp.y, p2.x, p2.y);
|
||||||
|
|
||||||
|
return Some(p2);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
i = (i + 1) % directions.len();
|
||||||
|
}
|
||||||
|
|
||||||
|
//println!("({}, {}) had no valid position", cp.x, cp.y);
|
||||||
|
Some(cp)
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
fn simulate_round(elves :&mut Vec<Elve>, directions :&Vec<Direction>, current_dir :usize) -> bool {
|
||||||
|
|
||||||
|
let mut elve_has_changed = false;
|
||||||
|
|
||||||
|
// go throug the directions for every elve & pick the first fitting
|
||||||
|
for i in 0..elves.len() {
|
||||||
|
let future_pos = calculate_future_pos(elves, i, directions, current_dir);
|
||||||
|
|
||||||
|
match future_pos {
|
||||||
|
Some(s) => {
|
||||||
|
elve_has_changed = true;
|
||||||
|
elves[i].future_pos = Some(s);
|
||||||
|
}
|
||||||
|
|
||||||
|
None => {}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
if !elve_has_changed {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
// look throug all elves and check if there are repeating positions
|
||||||
|
let mut duplicates = Vec::new();
|
||||||
|
let mut save = HashSet::new();
|
||||||
|
|
||||||
|
for i in 0..elves.len() {
|
||||||
|
|
||||||
|
match elves[i].future_pos {
|
||||||
|
Some(s) => {
|
||||||
|
|
||||||
|
|
||||||
|
if save.contains(&s) {
|
||||||
|
duplicates.push(s);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
save.insert(s);
|
||||||
|
}
|
||||||
|
|
||||||
|
None => {}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// remove duplicate positions
|
||||||
|
for p in duplicates {
|
||||||
|
for i in 0..elves.len() {
|
||||||
|
|
||||||
|
match elves[i].future_pos {
|
||||||
|
Some (s) => {
|
||||||
|
|
||||||
|
if s.eq(&p) {
|
||||||
|
//println!("Collided: ({}, {})", p.x, p.y);
|
||||||
|
elves[i].future_pos = None;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
None => {}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// move elves with future_pos to future_pos
|
||||||
|
for elve in elves {
|
||||||
|
match elve.future_pos {
|
||||||
|
Some(s) => {
|
||||||
|
elve.pos = s;
|
||||||
|
}
|
||||||
|
None => {}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
true
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
fn find_borders(elves :&Vec<Elve>) -> (Pos, Pos) {
|
||||||
|
let mut min = Pos::from(i32::MAX, i32::MAX);
|
||||||
|
let mut max = Pos::from(i32::MIN, i32::MIN);
|
||||||
|
|
||||||
|
for elve in elves {
|
||||||
|
if elve.pos.x > max.x {
|
||||||
|
max.x = elve.pos.x;
|
||||||
|
}
|
||||||
|
|
||||||
|
if elve.pos.y > max.y {
|
||||||
|
max.y = elve.pos.y;
|
||||||
|
}
|
||||||
|
|
||||||
|
if elve.pos.x < min.x {
|
||||||
|
min.x = elve.pos.x;
|
||||||
|
}
|
||||||
|
|
||||||
|
if elve.pos.y < min.y {
|
||||||
|
min.y = elve.pos.y;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
(min, max)
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
fn print_board(elves :&Vec<Elve>, mut min :Pos, mut max :Pos) {
|
||||||
|
|
||||||
|
if max.y < 0 || max.x < 0 {
|
||||||
|
println!("Fuck");
|
||||||
|
std::process::exit(1);
|
||||||
|
}
|
||||||
|
|
||||||
|
let mut y_off = 0;
|
||||||
|
let mut x_off = 0;
|
||||||
|
|
||||||
|
if min.y < 0 {
|
||||||
|
y_off = min.y.abs();
|
||||||
|
min.y = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
if min.x < 0 {
|
||||||
|
x_off = min.x.abs();
|
||||||
|
min.x = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
let mut map = vec![vec!['.'; (max.x - min.x + x_off + 1) as usize]; (max.y - min.y + y_off + 1) as usize];
|
||||||
|
|
||||||
|
for e in elves {
|
||||||
|
map[(e.pos.y - min.y + y_off) as usize][(e.pos.x - min.x + x_off) as usize] = '#';
|
||||||
|
}
|
||||||
|
|
||||||
|
for l in map {
|
||||||
|
for c in l {
|
||||||
|
print!("{}", c);
|
||||||
|
}
|
||||||
|
println!();
|
||||||
|
}
|
||||||
|
println!();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
pub fn run(inp :Vec<String>) {
|
pub fn run(inp :Vec<String>) {
|
||||||
|
let mut elves = parse_input(inp);
|
||||||
|
|
||||||
|
let mut current_direction = 0; // cycles through 0..3
|
||||||
|
|
||||||
|
let directions = vec![
|
||||||
|
Direction::NORTH,
|
||||||
|
Direction::SOUTH,
|
||||||
|
Direction::WEST,
|
||||||
|
Direction::EAST,
|
||||||
|
];
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
for i in 0..1000 {
|
||||||
|
//let (min, max) = find_borders(&elves);
|
||||||
|
|
||||||
|
|
||||||
|
//println!();
|
||||||
|
//println!("{}: ", i);
|
||||||
|
//print_board(&elves, min, max);
|
||||||
|
|
||||||
|
|
||||||
|
if !simulate_round(&mut elves, &directions, current_direction) {
|
||||||
|
println!("a2: {}", i+1);
|
||||||
|
std::process::exit(0);
|
||||||
|
}
|
||||||
|
current_direction = (current_direction + 1) % directions.len();
|
||||||
|
}
|
||||||
|
|
||||||
|
println!("a2: Nothing found");
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
1
d23/target/.rustc_info.json
Normal file
1
d23/target/.rustc_info.json
Normal file
@ -0,0 +1 @@
|
|||||||
|
{"rustc_fingerprint":15594459422025777716,"outputs":{"8204103499295538959":{"success":true,"status":"","code":0,"stdout":"___.exe\nlib___.rlib\n___.dll\n___.dll\n___.lib\n___.dll\nC:\\Users\\tfuec\\.rustup\\toolchains\\stable-x86_64-pc-windows-msvc\ndebug_assertions\npanic=\"unwind\"\nproc_macro\ntarget_arch=\"x86_64\"\ntarget_endian=\"little\"\ntarget_env=\"msvc\"\ntarget_family=\"windows\"\ntarget_feature=\"fxsr\"\ntarget_feature=\"sse\"\ntarget_feature=\"sse2\"\ntarget_has_atomic=\"16\"\ntarget_has_atomic=\"32\"\ntarget_has_atomic=\"64\"\ntarget_has_atomic=\"8\"\ntarget_has_atomic=\"ptr\"\ntarget_os=\"windows\"\ntarget_pointer_width=\"64\"\ntarget_vendor=\"pc\"\nwindows\n","stderr":""},"8623966523033996810":{"success":true,"status":"","code":0,"stdout":"___.exe\nlib___.rlib\n___.dll\n___.dll\n___.lib\n___.dll\n","stderr":""},"15697416045686424142":{"success":true,"status":"","code":0,"stdout":"___.exe\nlib___.rlib\n___.dll\n___.dll\n___.lib\n___.dll\n","stderr":""},"4614504638168534921":{"success":true,"status":"","code":0,"stdout":"rustc 1.65.0 (897e37553 2022-11-02)\nbinary: rustc\ncommit-hash: 897e37553bba8b42751c67658967889d11ecd120\ncommit-date: 2022-11-02\nhost: x86_64-pc-windows-msvc\nrelease: 1.65.0\nLLVM version: 15.0.0\n","stderr":""},"10376369925670944939":{"success":true,"status":"","code":0,"stdout":"___.exe\nlib___.rlib\n___.dll\n___.dll\n___.lib\n___.dll\nC:\\Users\\tfuec\\.rustup\\toolchains\\stable-x86_64-pc-windows-msvc\ndebug_assertions\npanic=\"unwind\"\nproc_macro\ntarget_arch=\"x86_64\"\ntarget_endian=\"little\"\ntarget_env=\"msvc\"\ntarget_family=\"windows\"\ntarget_feature=\"fxsr\"\ntarget_feature=\"sse\"\ntarget_feature=\"sse2\"\ntarget_has_atomic=\"16\"\ntarget_has_atomic=\"32\"\ntarget_has_atomic=\"64\"\ntarget_has_atomic=\"8\"\ntarget_has_atomic=\"ptr\"\ntarget_os=\"windows\"\ntarget_pointer_width=\"64\"\ntarget_vendor=\"pc\"\nwindows\n","stderr":""}},"successes":{}}
|
3
d23/target/CACHEDIR.TAG
Normal file
3
d23/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
d23/target/debug/.cargo-lock
Normal file
0
d23/target/debug/.cargo-lock
Normal file
@ -0,0 +1 @@
|
|||||||
|
a62220af2acc103e
|
@ -0,0 +1 @@
|
|||||||
|
{"rustc":2347157018072859861,"features":"[]","target":16997346216964277088,"profile":7309141686862299243,"path":1684066648322511884,"deps":[],"local":[{"CheckDepInfo":{"dep_info":"debug\\.fingerprint\\d05-54bad1502471c435\\dep-bin-d05"}}],"rustflags":[],"metadata":7797948686568424061,"config":2202906307356721367,"compile_kind":0}
|
BIN
d23/target/debug/.fingerprint/d05-54bad1502471c435/dep-bin-d05
Normal file
BIN
d23/target/debug/.fingerprint/d05-54bad1502471c435/dep-bin-d05
Normal file
Binary file not shown.
@ -0,0 +1 @@
|
|||||||
|
This file has an mtime of when this was started.
|
@ -0,0 +1,6 @@
|
|||||||
|
{"message":"unused variable: `i`","code":{"code":"unused_variables","explanation":null},"level":"warning","spans":[{"file_name":"src\\a1.rs","byte_start":6631,"byte_end":6632,"line_start":296,"line_end":296,"column_start":9,"column_end":10,"is_primary":true,"text":[{"text":" for i in 0..10 {","highlight_start":9,"highlight_end":10}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"`#[warn(unused_variables)]` on by default","code":null,"level":"note","spans":[],"children":[],"rendered":null},{"message":"if this is intentional, prefix it with an underscore","code":null,"level":"help","spans":[{"file_name":"src\\a1.rs","byte_start":6631,"byte_end":6632,"line_start":296,"line_end":296,"column_start":9,"column_end":10,"is_primary":true,"text":[{"text":" for i in 0..10 {","highlight_start":9,"highlight_end":10}],"label":null,"suggested_replacement":"_i","suggestion_applicability":"MachineApplicable","expansion":null}],"children":[],"rendered":null}],"rendered":"\u001b[0m\u001b[1m\u001b[38;5;11mwarning\u001b[0m\u001b[0m\u001b[1m\u001b[38;5;15m: unused variable: `i`\u001b[0m\n\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;14m--> \u001b[0m\u001b[0msrc\\a1.rs:296:9\u001b[0m\n\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;14m|\u001b[0m\n\u001b[0m\u001b[1m\u001b[38;5;14m296\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;14m|\u001b[0m\u001b[0m \u001b[0m\u001b[0m for i in 0..10 {\u001b[0m\n\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;14m| \u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;11m^\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;11mhelp: if this is intentional, prefix it with an underscore: `_i`\u001b[0m\n\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;14m|\u001b[0m\n\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;14m= \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;15mnote\u001b[0m\u001b[0m: `#[warn(unused_variables)]` on by default\u001b[0m\n\n"}
|
||||||
|
{"message":"variable does not need to be mutable","code":{"code":"unused_mut","explanation":null},"level":"warning","spans":[{"file_name":"src\\a1.rs","byte_start":5613,"byte_end":5620,"line_start":246,"line_end":246,"column_start":49,"column_end":56,"is_primary":true,"text":[{"text":"fn print_board(elves :&Vec<Elve>, mut min :Pos, mut max :Pos) {","highlight_start":49,"highlight_end":56}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"`#[warn(unused_mut)]` on by default","code":null,"level":"note","spans":[],"children":[],"rendered":null},{"message":"remove this `mut`","code":null,"level":"help","spans":[{"file_name":"src\\a1.rs","byte_start":5613,"byte_end":5617,"line_start":246,"line_end":246,"column_start":49,"column_end":53,"is_primary":true,"text":[{"text":"fn print_board(elves :&Vec<Elve>, mut min :Pos, mut max :Pos) {","highlight_start":49,"highlight_end":53}],"label":null,"suggested_replacement":"","suggestion_applicability":"MachineApplicable","expansion":null}],"children":[],"rendered":null}],"rendered":"\u001b[0m\u001b[1m\u001b[38;5;11mwarning\u001b[0m\u001b[0m\u001b[1m\u001b[38;5;15m: variable does not need to be mutable\u001b[0m\n\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;14m--> \u001b[0m\u001b[0msrc\\a1.rs:246:49\u001b[0m\n\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;14m|\u001b[0m\n\u001b[0m\u001b[1m\u001b[38;5;14m246\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;14m|\u001b[0m\u001b[0m \u001b[0m\u001b[0mfn print_board(elves :&Vec<Elve>, mut min :Pos, mut max :Pos) {\u001b[0m\n\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;14m| \u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;14m----\u001b[0m\u001b[0m\u001b[1m\u001b[38;5;11m^^^\u001b[0m\n\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;14m| \u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;14m|\u001b[0m\n\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;14m| \u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;14mhelp: remove this `mut`\u001b[0m\n\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;14m|\u001b[0m\n\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;14m= \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;15mnote\u001b[0m\u001b[0m: `#[warn(unused_mut)]` on by default\u001b[0m\n\n"}
|
||||||
|
{"message":"variable does not need to be mutable","code":{"code":"unused_mut","explanation":null},"level":"warning","spans":[{"file_name":"src\\a2.rs","byte_start":5910,"byte_end":5917,"line_start":263,"line_end":263,"column_start":49,"column_end":56,"is_primary":true,"text":[{"text":"fn print_board(elves :&Vec<Elve>, mut min :Pos, mut max :Pos) {","highlight_start":49,"highlight_end":56}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"remove this `mut`","code":null,"level":"help","spans":[{"file_name":"src\\a2.rs","byte_start":5910,"byte_end":5914,"line_start":263,"line_end":263,"column_start":49,"column_end":53,"is_primary":true,"text":[{"text":"fn print_board(elves :&Vec<Elve>, mut min :Pos, mut max :Pos) {","highlight_start":49,"highlight_end":53}],"label":null,"suggested_replacement":"","suggestion_applicability":"MachineApplicable","expansion":null}],"children":[],"rendered":null}],"rendered":"\u001b[0m\u001b[1m\u001b[38;5;11mwarning\u001b[0m\u001b[0m\u001b[1m\u001b[38;5;15m: variable does not need to be mutable\u001b[0m\n\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;14m--> \u001b[0m\u001b[0msrc\\a2.rs:263:49\u001b[0m\n\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;14m|\u001b[0m\n\u001b[0m\u001b[1m\u001b[38;5;14m263\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;14m|\u001b[0m\u001b[0m \u001b[0m\u001b[0mfn print_board(elves :&Vec<Elve>, mut min :Pos, mut max :Pos) {\u001b[0m\n\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;14m| \u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;14m----\u001b[0m\u001b[0m\u001b[1m\u001b[38;5;11m^^^\u001b[0m\n\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;14m| \u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;14m|\u001b[0m\n\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;14m| \u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;14mhelp: remove this `mut`\u001b[0m\n\n"}
|
||||||
|
{"message":"function `find_borders` is never used","code":{"code":"dead_code","explanation":null},"level":"warning","spans":[{"file_name":"src\\a2.rs","byte_start":5311,"byte_end":5323,"line_start":237,"line_end":237,"column_start":4,"column_end":16,"is_primary":true,"text":[{"text":"fn find_borders(elves :&Vec<Elve>) -> (Pos, Pos) {","highlight_start":4,"highlight_end":16}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"`#[warn(dead_code)]` on by default","code":null,"level":"note","spans":[],"children":[],"rendered":null}],"rendered":"\u001b[0m\u001b[1m\u001b[38;5;11mwarning\u001b[0m\u001b[0m\u001b[1m\u001b[38;5;15m: function `find_borders` is never used\u001b[0m\n\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;14m--> \u001b[0m\u001b[0msrc\\a2.rs:237:4\u001b[0m\n\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;14m|\u001b[0m\n\u001b[0m\u001b[1m\u001b[38;5;14m237\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;14m|\u001b[0m\u001b[0m \u001b[0m\u001b[0mfn find_borders(elves :&Vec<Elve>) -> (Pos, Pos) {\u001b[0m\n\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;14m| \u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;11m^^^^^^^^^^^^\u001b[0m\n\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;14m|\u001b[0m\n\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;14m= \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;15mnote\u001b[0m\u001b[0m: `#[warn(dead_code)]` on by default\u001b[0m\n\n"}
|
||||||
|
{"message":"function `print_board` is never used","code":{"code":"dead_code","explanation":null},"level":"warning","spans":[{"file_name":"src\\a2.rs","byte_start":5865,"byte_end":5876,"line_start":263,"line_end":263,"column_start":4,"column_end":15,"is_primary":true,"text":[{"text":"fn print_board(elves :&Vec<Elve>, mut min :Pos, mut max :Pos) {","highlight_start":4,"highlight_end":15}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":"\u001b[0m\u001b[1m\u001b[38;5;11mwarning\u001b[0m\u001b[0m\u001b[1m\u001b[38;5;15m: function `print_board` is never used\u001b[0m\n\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;14m--> \u001b[0m\u001b[0msrc\\a2.rs:263:4\u001b[0m\n\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;14m|\u001b[0m\n\u001b[0m\u001b[1m\u001b[38;5;14m263\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;14m|\u001b[0m\u001b[0m \u001b[0m\u001b[0mfn print_board(elves :&Vec<Elve>, mut min :Pos, mut max :Pos) {\u001b[0m\n\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;14m| \u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;11m^^^^^^^^^^^\u001b[0m\n\n"}
|
||||||
|
{"message":"5 warnings emitted","code":null,"level":"warning","spans":[],"children":[],"rendered":"\u001b[0m\u001b[1m\u001b[38;5;11mwarning\u001b[0m\u001b[0m\u001b[1m\u001b[38;5;15m: 5 warnings emitted\u001b[0m\n\n"}
|
@ -0,0 +1 @@
|
|||||||
|
e737b342d3e62e08
|
@ -0,0 +1 @@
|
|||||||
|
{"rustc":2347157018072859861,"features":"[]","target":16997346216964277088,"profile":9251013656241001069,"path":1684066648322511884,"deps":[],"local":[{"CheckDepInfo":{"dep_info":"debug\\.fingerprint\\d05-60235cbe9d69ff8a\\dep-bin-d05"}}],"rustflags":[],"metadata":7797948686568424061,"config":2202906307356721367,"compile_kind":0}
|
BIN
d23/target/debug/.fingerprint/d05-60235cbe9d69ff8a/dep-bin-d05
Normal file
BIN
d23/target/debug/.fingerprint/d05-60235cbe9d69ff8a/dep-bin-d05
Normal file
Binary file not shown.
@ -0,0 +1 @@
|
|||||||
|
This file has an mtime of when this was started.
|
@ -0,0 +1,14 @@
|
|||||||
|
{"message":"unused variable: `i`","code":{"code":"unused_variables","explanation":null},"level":"warning","spans":[{"file_name":"src\\a1.rs","byte_start":6631,"byte_end":6632,"line_start":296,"line_end":296,"column_start":9,"column_end":10,"is_primary":true,"text":[{"text":" for i in 0..10 {","highlight_start":9,"highlight_end":10}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"`#[warn(unused_variables)]` on by default","code":null,"level":"note","spans":[],"children":[],"rendered":null},{"message":"if this is intentional, prefix it with an underscore","code":null,"level":"help","spans":[{"file_name":"src\\a1.rs","byte_start":6631,"byte_end":6632,"line_start":296,"line_end":296,"column_start":9,"column_end":10,"is_primary":true,"text":[{"text":" for i in 0..10 {","highlight_start":9,"highlight_end":10}],"label":null,"suggested_replacement":"_i","suggestion_applicability":"MachineApplicable","expansion":null}],"children":[],"rendered":null}],"rendered":"\u001b[0m\u001b[1m\u001b[38;5;11mwarning\u001b[0m\u001b[0m\u001b[1m\u001b[38;5;15m: unused variable: `i`\u001b[0m\n\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;14m--> \u001b[0m\u001b[0msrc\\a1.rs:296:9\u001b[0m\n\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;14m|\u001b[0m\n\u001b[0m\u001b[1m\u001b[38;5;14m296\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;14m|\u001b[0m\u001b[0m \u001b[0m\u001b[0m for i in 0..10 {\u001b[0m\n\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;14m| \u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;11m^\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;11mhelp: if this is intentional, prefix it with an underscore: `_i`\u001b[0m\n\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;14m|\u001b[0m\n\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;14m= \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;15mnote\u001b[0m\u001b[0m: `#[warn(unused_variables)]` on by default\u001b[0m\n\n"}
|
||||||
|
{"message":"variable does not need to be mutable","code":{"code":"unused_mut","explanation":null},"level":"warning","spans":[{"file_name":"src\\a1.rs","byte_start":5613,"byte_end":5620,"line_start":246,"line_end":246,"column_start":49,"column_end":56,"is_primary":true,"text":[{"text":"fn print_board(elves :&Vec<Elve>, mut min :Pos, mut max :Pos) {","highlight_start":49,"highlight_end":56}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"`#[warn(unused_mut)]` on by default","code":null,"level":"note","spans":[],"children":[],"rendered":null},{"message":"remove this `mut`","code":null,"level":"help","spans":[{"file_name":"src\\a1.rs","byte_start":5613,"byte_end":5617,"line_start":246,"line_end":246,"column_start":49,"column_end":53,"is_primary":true,"text":[{"text":"fn print_board(elves :&Vec<Elve>, mut min :Pos, mut max :Pos) {","highlight_start":49,"highlight_end":53}],"label":null,"suggested_replacement":"","suggestion_applicability":"MachineApplicable","expansion":null}],"children":[],"rendered":null}],"rendered":"\u001b[0m\u001b[1m\u001b[38;5;11mwarning\u001b[0m\u001b[0m\u001b[1m\u001b[38;5;15m: variable does not need to be mutable\u001b[0m\n\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;14m--> \u001b[0m\u001b[0msrc\\a1.rs:246:49\u001b[0m\n\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;14m|\u001b[0m\n\u001b[0m\u001b[1m\u001b[38;5;14m246\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;14m|\u001b[0m\u001b[0m \u001b[0m\u001b[0mfn print_board(elves :&Vec<Elve>, mut min :Pos, mut max :Pos) {\u001b[0m\n\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;14m| \u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;14m----\u001b[0m\u001b[0m\u001b[1m\u001b[38;5;11m^^^\u001b[0m\n\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;14m| \u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;14m|\u001b[0m\n\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;14m| \u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;14mhelp: remove this `mut`\u001b[0m\n\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;14m|\u001b[0m\n\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;14m= \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;15mnote\u001b[0m\u001b[0m: `#[warn(unused_mut)]` on by default\u001b[0m\n\n"}
|
||||||
|
{"message":"variable does not need to be mutable","code":{"code":"unused_mut","explanation":null},"level":"warning","spans":[{"file_name":"src\\a2.rs","byte_start":5910,"byte_end":5917,"line_start":263,"line_end":263,"column_start":49,"column_end":56,"is_primary":true,"text":[{"text":"fn print_board(elves :&Vec<Elve>, mut min :Pos, mut max :Pos) {","highlight_start":49,"highlight_end":56}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"remove this `mut`","code":null,"level":"help","spans":[{"file_name":"src\\a2.rs","byte_start":5910,"byte_end":5914,"line_start":263,"line_end":263,"column_start":49,"column_end":53,"is_primary":true,"text":[{"text":"fn print_board(elves :&Vec<Elve>, mut min :Pos, mut max :Pos) {","highlight_start":49,"highlight_end":53}],"label":null,"suggested_replacement":"","suggestion_applicability":"MachineApplicable","expansion":null}],"children":[],"rendered":null}],"rendered":"\u001b[0m\u001b[1m\u001b[38;5;11mwarning\u001b[0m\u001b[0m\u001b[1m\u001b[38;5;15m: variable does not need to be mutable\u001b[0m\n\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;14m--> \u001b[0m\u001b[0msrc\\a2.rs:263:49\u001b[0m\n\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;14m|\u001b[0m\n\u001b[0m\u001b[1m\u001b[38;5;14m263\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;14m|\u001b[0m\u001b[0m \u001b[0m\u001b[0mfn print_board(elves :&Vec<Elve>, mut min :Pos, mut max :Pos) {\u001b[0m\n\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;14m| \u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;14m----\u001b[0m\u001b[0m\u001b[1m\u001b[38;5;11m^^^\u001b[0m\n\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;14m| \u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;14m|\u001b[0m\n\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;14m| \u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;14mhelp: remove this `mut`\u001b[0m\n\n"}
|
||||||
|
{"message":"enum `Direction` is never used","code":{"code":"dead_code","explanation":null},"level":"warning","spans":[{"file_name":"src\\a2.rs","byte_start":636,"byte_end":645,"line_start":40,"line_end":40,"column_start":6,"column_end":15,"is_primary":true,"text":[{"text":"enum Direction {","highlight_start":6,"highlight_end":15}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"`#[warn(dead_code)]` on by default","code":null,"level":"note","spans":[],"children":[],"rendered":null}],"rendered":"\u001b[0m\u001b[1m\u001b[38;5;11mwarning\u001b[0m\u001b[0m\u001b[1m\u001b[38;5;15m: enum `Direction` is never used\u001b[0m\n\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;14m--> \u001b[0m\u001b[0msrc\\a2.rs:40:6\u001b[0m\n\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;14m|\u001b[0m\n\u001b[0m\u001b[1m\u001b[38;5;14m40\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;14m|\u001b[0m\u001b[0m \u001b[0m\u001b[0menum Direction {\u001b[0m\n\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;14m| \u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;11m^^^^^^^^^\u001b[0m\n\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;14m|\u001b[0m\n\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;14m= \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;15mnote\u001b[0m\u001b[0m: `#[warn(dead_code)]` on by default\u001b[0m\n\n"}
|
||||||
|
{"message":"function `parse_input` is never used","code":{"code":"dead_code","explanation":null},"level":"warning","spans":[{"file_name":"src\\a2.rs","byte_start":706,"byte_end":717,"line_start":47,"line_end":47,"column_start":4,"column_end":15,"is_primary":true,"text":[{"text":"fn parse_input(inp :Vec<String>) -> Vec<Elve> {","highlight_start":4,"highlight_end":15}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":"\u001b[0m\u001b[1m\u001b[38;5;11mwarning\u001b[0m\u001b[0m\u001b[1m\u001b[38;5;15m: function `parse_input` is never used\u001b[0m\n\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;14m--> \u001b[0m\u001b[0msrc\\a2.rs:47:4\u001b[0m\n\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;14m|\u001b[0m\n\u001b[0m\u001b[1m\u001b[38;5;14m47\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;14m|\u001b[0m\u001b[0m \u001b[0m\u001b[0mfn parse_input(inp :Vec<String>) -> Vec<Elve> {\u001b[0m\n\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;14m| \u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;11m^^^^^^^^^^^\u001b[0m\n\n"}
|
||||||
|
{"message":"function `has_neighbours` is never used","code":{"code":"dead_code","explanation":null},"level":"warning","spans":[{"file_name":"src\\a2.rs","byte_start":1024,"byte_end":1038,"line_start":64,"line_end":64,"column_start":4,"column_end":18,"is_primary":true,"text":[{"text":"fn has_neighbours(elves :&Vec<Elve>, cp :&Pos) -> bool {","highlight_start":4,"highlight_end":18}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":"\u001b[0m\u001b[1m\u001b[38;5;11mwarning\u001b[0m\u001b[0m\u001b[1m\u001b[38;5;15m: function `has_neighbours` is never used\u001b[0m\n\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;14m--> \u001b[0m\u001b[0msrc\\a2.rs:64:4\u001b[0m\n\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;14m|\u001b[0m\n\u001b[0m\u001b[1m\u001b[38;5;14m64\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;14m|\u001b[0m\u001b[0m \u001b[0m\u001b[0mfn has_neighbours(elves :&Vec<Elve>, cp :&Pos) -> bool {\u001b[0m\n\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;14m| \u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;11m^^^^^^^^^^^^^^\u001b[0m\n\n"}
|
||||||
|
{"message":"function `calculate_future_pos` is never used","code":{"code":"dead_code","explanation":null},"level":"warning","spans":[{"file_name":"src\\a2.rs","byte_start":1518,"byte_end":1538,"line_start":88,"line_end":88,"column_start":4,"column_end":24,"is_primary":true,"text":[{"text":"fn calculate_future_pos(elves :&Vec<Elve>, i :usize, directions :&Vec<Direction>, current_dir :usize) -> Option<Pos> {","highlight_start":4,"highlight_end":24}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":"\u001b[0m\u001b[1m\u001b[38;5;11mwarning\u001b[0m\u001b[0m\u001b[1m\u001b[38;5;15m: function `calculate_future_pos` is never used\u001b[0m\n\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;14m--> \u001b[0m\u001b[0msrc\\a2.rs:88:4\u001b[0m\n\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;14m|\u001b[0m\n\u001b[0m\u001b[1m\u001b[38;5;14m88\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;14m|\u001b[0m\u001b[0m \u001b[0m\u001b[0mfn calculate_future_pos(elves :&Vec<Elve>, i :usize, directions :&Vec<Direction>, current_dir :usize) -> Option<Pos> {\u001b[0m\n\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;14m| \u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;11m^^^^^^^^^^^^^^^^^^^^\u001b[0m\n\n"}
|
||||||
|
{"message":"function `simulate_round` is never used","code":{"code":"dead_code","explanation":null},"level":"warning","spans":[{"file_name":"src\\a2.rs","byte_start":3514,"byte_end":3528,"line_start":159,"line_end":159,"column_start":4,"column_end":18,"is_primary":true,"text":[{"text":"fn simulate_round(elves :&mut Vec<Elve>, directions :&Vec<Direction>, current_dir :usize) -> bool {","highlight_start":4,"highlight_end":18}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":"\u001b[0m\u001b[1m\u001b[38;5;11mwarning\u001b[0m\u001b[0m\u001b[1m\u001b[38;5;15m: function `simulate_round` is never used\u001b[0m\n\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;14m--> \u001b[0m\u001b[0msrc\\a2.rs:159:4\u001b[0m\n\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;14m|\u001b[0m\n\u001b[0m\u001b[1m\u001b[38;5;14m159\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;14m|\u001b[0m\u001b[0m \u001b[0m\u001b[0mfn simulate_round(elves :&mut Vec<Elve>, directions :&Vec<Direction>, current_dir :usize) -> bool {\u001b[0m\n\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;14m| \u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;11m^^^^^^^^^^^^^^\u001b[0m\n\n"}
|
||||||
|
{"message":"function `find_borders` is never used","code":{"code":"dead_code","explanation":null},"level":"warning","spans":[{"file_name":"src\\a2.rs","byte_start":5311,"byte_end":5323,"line_start":237,"line_end":237,"column_start":4,"column_end":16,"is_primary":true,"text":[{"text":"fn find_borders(elves :&Vec<Elve>) -> (Pos, Pos) {","highlight_start":4,"highlight_end":16}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":"\u001b[0m\u001b[1m\u001b[38;5;11mwarning\u001b[0m\u001b[0m\u001b[1m\u001b[38;5;15m: function `find_borders` is never used\u001b[0m\n\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;14m--> \u001b[0m\u001b[0msrc\\a2.rs:237:4\u001b[0m\n\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;14m|\u001b[0m\n\u001b[0m\u001b[1m\u001b[38;5;14m237\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;14m|\u001b[0m\u001b[0m \u001b[0m\u001b[0mfn find_borders(elves :&Vec<Elve>) -> (Pos, Pos) {\u001b[0m\n\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;14m| \u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;11m^^^^^^^^^^^^\u001b[0m\n\n"}
|
||||||
|
{"message":"function `print_board` is never used","code":{"code":"dead_code","explanation":null},"level":"warning","spans":[{"file_name":"src\\a2.rs","byte_start":5865,"byte_end":5876,"line_start":263,"line_end":263,"column_start":4,"column_end":15,"is_primary":true,"text":[{"text":"fn print_board(elves :&Vec<Elve>, mut min :Pos, mut max :Pos) {","highlight_start":4,"highlight_end":15}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":"\u001b[0m\u001b[1m\u001b[38;5;11mwarning\u001b[0m\u001b[0m\u001b[1m\u001b[38;5;15m: function `print_board` is never used\u001b[0m\n\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;14m--> \u001b[0m\u001b[0msrc\\a2.rs:263:4\u001b[0m\n\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;14m|\u001b[0m\n\u001b[0m\u001b[1m\u001b[38;5;14m263\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;14m|\u001b[0m\u001b[0m \u001b[0m\u001b[0mfn print_board(elves :&Vec<Elve>, mut min :Pos, mut max :Pos) {\u001b[0m\n\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;14m| \u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;11m^^^^^^^^^^^\u001b[0m\n\n"}
|
||||||
|
{"message":"function `run` is never used","code":{"code":"dead_code","explanation":null},"level":"warning","spans":[{"file_name":"src\\a2.rs","byte_start":6630,"byte_end":6633,"line_start":299,"line_end":299,"column_start":8,"column_end":11,"is_primary":true,"text":[{"text":"pub fn run(inp :Vec<String>) {","highlight_start":8,"highlight_end":11}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":"\u001b[0m\u001b[1m\u001b[38;5;11mwarning\u001b[0m\u001b[0m\u001b[1m\u001b[38;5;15m: function `run` is never used\u001b[0m\n\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;14m--> \u001b[0m\u001b[0msrc\\a2.rs:299:8\u001b[0m\n\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;14m|\u001b[0m\n\u001b[0m\u001b[1m\u001b[38;5;14m299\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;14m|\u001b[0m\u001b[0m \u001b[0m\u001b[0mpub fn run(inp :Vec<String>) {\u001b[0m\n\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;14m| \u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;11m^^^\u001b[0m\n\n"}
|
||||||
|
{"message":"associated function `from` is never used","code":{"code":"dead_code","explanation":null},"level":"warning","spans":[{"file_name":"src\\a2.rs","byte_start":174,"byte_end":178,"line_start":11,"line_end":11,"column_start":8,"column_end":12,"is_primary":true,"text":[{"text":" fn from(x :i32, y :i32) -> Self {","highlight_start":8,"highlight_end":12}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":"\u001b[0m\u001b[1m\u001b[38;5;11mwarning\u001b[0m\u001b[0m\u001b[1m\u001b[38;5;15m: associated function `from` is never used\u001b[0m\n\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;14m--> \u001b[0m\u001b[0msrc\\a2.rs:11:8\u001b[0m\n\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;14m|\u001b[0m\n\u001b[0m\u001b[1m\u001b[38;5;14m11\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;14m|\u001b[0m\u001b[0m \u001b[0m\u001b[0m fn from(x :i32, y :i32) -> Self {\u001b[0m\n\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;14m| \u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;11m^^^^\u001b[0m\n\n"}
|
||||||
|
{"message":"associated function `from` is never used","code":{"code":"dead_code","explanation":null},"level":"warning","spans":[{"file_name":"src\\a2.rs","byte_start":559,"byte_end":563,"line_start":35,"line_end":35,"column_start":8,"column_end":12,"is_primary":true,"text":[{"text":" fn from(x :i32, y :i32) -> Self {","highlight_start":8,"highlight_end":12}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":"\u001b[0m\u001b[1m\u001b[38;5;11mwarning\u001b[0m\u001b[0m\u001b[1m\u001b[38;5;15m: associated function `from` is never used\u001b[0m\n\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;14m--> \u001b[0m\u001b[0msrc\\a2.rs:35:8\u001b[0m\n\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;14m|\u001b[0m\n\u001b[0m\u001b[1m\u001b[38;5;14m35\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;14m|\u001b[0m\u001b[0m \u001b[0m\u001b[0m fn from(x :i32, y :i32) -> Self {\u001b[0m\n\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;14m| \u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;11m^^^^\u001b[0m\n\n"}
|
||||||
|
{"message":"13 warnings emitted","code":null,"level":"warning","spans":[],"children":[],"rendered":"\u001b[0m\u001b[1m\u001b[38;5;11mwarning\u001b[0m\u001b[0m\u001b[1m\u001b[38;5;15m: 13 warnings emitted\u001b[0m\n\n"}
|
Binary file not shown.
@ -0,0 +1 @@
|
|||||||
|
This file has an mtime of when this was started.
|
@ -0,0 +1,6 @@
|
|||||||
|
{"message":"unused variable: `i`","code":{"code":"unused_variables","explanation":null},"level":"warning","spans":[{"file_name":"src\\a1.rs","byte_start":6631,"byte_end":6632,"line_start":296,"line_end":296,"column_start":9,"column_end":10,"is_primary":true,"text":[{"text":" for i in 0..10 {","highlight_start":9,"highlight_end":10}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"`#[warn(unused_variables)]` on by default","code":null,"level":"note","spans":[],"children":[],"rendered":null},{"message":"if this is intentional, prefix it with an underscore","code":null,"level":"help","spans":[{"file_name":"src\\a1.rs","byte_start":6631,"byte_end":6632,"line_start":296,"line_end":296,"column_start":9,"column_end":10,"is_primary":true,"text":[{"text":" for i in 0..10 {","highlight_start":9,"highlight_end":10}],"label":null,"suggested_replacement":"_i","suggestion_applicability":"MachineApplicable","expansion":null}],"children":[],"rendered":null}],"rendered":"\u001b[0m\u001b[1m\u001b[38;5;11mwarning\u001b[0m\u001b[0m\u001b[1m\u001b[38;5;15m: unused variable: `i`\u001b[0m\n\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;14m--> \u001b[0m\u001b[0msrc\\a1.rs:296:9\u001b[0m\n\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;14m|\u001b[0m\n\u001b[0m\u001b[1m\u001b[38;5;14m296\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;14m|\u001b[0m\u001b[0m \u001b[0m\u001b[0m for i in 0..10 {\u001b[0m\n\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;14m| \u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;11m^\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;11mhelp: if this is intentional, prefix it with an underscore: `_i`\u001b[0m\n\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;14m|\u001b[0m\n\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;14m= \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;15mnote\u001b[0m\u001b[0m: `#[warn(unused_variables)]` on by default\u001b[0m\n\n"}
|
||||||
|
{"message":"variable does not need to be mutable","code":{"code":"unused_mut","explanation":null},"level":"warning","spans":[{"file_name":"src\\a1.rs","byte_start":5613,"byte_end":5620,"line_start":246,"line_end":246,"column_start":49,"column_end":56,"is_primary":true,"text":[{"text":"fn print_board(elves :&Vec<Elve>, mut min :Pos, mut max :Pos) {","highlight_start":49,"highlight_end":56}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"`#[warn(unused_mut)]` on by default","code":null,"level":"note","spans":[],"children":[],"rendered":null},{"message":"remove this `mut`","code":null,"level":"help","spans":[{"file_name":"src\\a1.rs","byte_start":5613,"byte_end":5617,"line_start":246,"line_end":246,"column_start":49,"column_end":53,"is_primary":true,"text":[{"text":"fn print_board(elves :&Vec<Elve>, mut min :Pos, mut max :Pos) {","highlight_start":49,"highlight_end":53}],"label":null,"suggested_replacement":"","suggestion_applicability":"MachineApplicable","expansion":null}],"children":[],"rendered":null}],"rendered":"\u001b[0m\u001b[1m\u001b[38;5;11mwarning\u001b[0m\u001b[0m\u001b[1m\u001b[38;5;15m: variable does not need to be mutable\u001b[0m\n\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;14m--> \u001b[0m\u001b[0msrc\\a1.rs:246:49\u001b[0m\n\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;14m|\u001b[0m\n\u001b[0m\u001b[1m\u001b[38;5;14m246\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;14m|\u001b[0m\u001b[0m \u001b[0m\u001b[0mfn print_board(elves :&Vec<Elve>, mut min :Pos, mut max :Pos) {\u001b[0m\n\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;14m| \u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;14m----\u001b[0m\u001b[0m\u001b[1m\u001b[38;5;11m^^^\u001b[0m\n\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;14m| \u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;14m|\u001b[0m\n\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;14m| \u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;14mhelp: remove this `mut`\u001b[0m\n\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;14m|\u001b[0m\n\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;14m= \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;15mnote\u001b[0m\u001b[0m: `#[warn(unused_mut)]` on by default\u001b[0m\n\n"}
|
||||||
|
{"message":"variable does not need to be mutable","code":{"code":"unused_mut","explanation":null},"level":"warning","spans":[{"file_name":"src\\a2.rs","byte_start":5910,"byte_end":5917,"line_start":263,"line_end":263,"column_start":49,"column_end":56,"is_primary":true,"text":[{"text":"fn print_board(elves :&Vec<Elve>, mut min :Pos, mut max :Pos) {","highlight_start":49,"highlight_end":56}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"remove this `mut`","code":null,"level":"help","spans":[{"file_name":"src\\a2.rs","byte_start":5910,"byte_end":5914,"line_start":263,"line_end":263,"column_start":49,"column_end":53,"is_primary":true,"text":[{"text":"fn print_board(elves :&Vec<Elve>, mut min :Pos, mut max :Pos) {","highlight_start":49,"highlight_end":53}],"label":null,"suggested_replacement":"","suggestion_applicability":"MachineApplicable","expansion":null}],"children":[],"rendered":null}],"rendered":"\u001b[0m\u001b[1m\u001b[38;5;11mwarning\u001b[0m\u001b[0m\u001b[1m\u001b[38;5;15m: variable does not need to be mutable\u001b[0m\n\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;14m--> \u001b[0m\u001b[0msrc\\a2.rs:263:49\u001b[0m\n\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;14m|\u001b[0m\n\u001b[0m\u001b[1m\u001b[38;5;14m263\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;14m|\u001b[0m\u001b[0m \u001b[0m\u001b[0mfn print_board(elves :&Vec<Elve>, mut min :Pos, mut max :Pos) {\u001b[0m\n\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;14m| \u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;14m----\u001b[0m\u001b[0m\u001b[1m\u001b[38;5;11m^^^\u001b[0m\n\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;14m| \u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;14m|\u001b[0m\n\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;14m| \u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;14mhelp: remove this `mut`\u001b[0m\n\n"}
|
||||||
|
{"message":"function `find_borders` is never used","code":{"code":"dead_code","explanation":null},"level":"warning","spans":[{"file_name":"src\\a2.rs","byte_start":5311,"byte_end":5323,"line_start":237,"line_end":237,"column_start":4,"column_end":16,"is_primary":true,"text":[{"text":"fn find_borders(elves :&Vec<Elve>) -> (Pos, Pos) {","highlight_start":4,"highlight_end":16}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"`#[warn(dead_code)]` on by default","code":null,"level":"note","spans":[],"children":[],"rendered":null}],"rendered":"\u001b[0m\u001b[1m\u001b[38;5;11mwarning\u001b[0m\u001b[0m\u001b[1m\u001b[38;5;15m: function `find_borders` is never used\u001b[0m\n\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;14m--> \u001b[0m\u001b[0msrc\\a2.rs:237:4\u001b[0m\n\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;14m|\u001b[0m\n\u001b[0m\u001b[1m\u001b[38;5;14m237\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;14m|\u001b[0m\u001b[0m \u001b[0m\u001b[0mfn find_borders(elves :&Vec<Elve>) -> (Pos, Pos) {\u001b[0m\n\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;14m| \u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;11m^^^^^^^^^^^^\u001b[0m\n\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;14m|\u001b[0m\n\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;14m= \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;15mnote\u001b[0m\u001b[0m: `#[warn(dead_code)]` on by default\u001b[0m\n\n"}
|
||||||
|
{"message":"function `print_board` is never used","code":{"code":"dead_code","explanation":null},"level":"warning","spans":[{"file_name":"src\\a2.rs","byte_start":5865,"byte_end":5876,"line_start":263,"line_end":263,"column_start":4,"column_end":15,"is_primary":true,"text":[{"text":"fn print_board(elves :&Vec<Elve>, mut min :Pos, mut max :Pos) {","highlight_start":4,"highlight_end":15}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":"\u001b[0m\u001b[1m\u001b[38;5;11mwarning\u001b[0m\u001b[0m\u001b[1m\u001b[38;5;15m: function `print_board` is never used\u001b[0m\n\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;14m--> \u001b[0m\u001b[0msrc\\a2.rs:263:4\u001b[0m\n\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;14m|\u001b[0m\n\u001b[0m\u001b[1m\u001b[38;5;14m263\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;14m|\u001b[0m\u001b[0m \u001b[0m\u001b[0mfn print_board(elves :&Vec<Elve>, mut min :Pos, mut max :Pos) {\u001b[0m\n\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;14m| \u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;11m^^^^^^^^^^^\u001b[0m\n\n"}
|
||||||
|
{"message":"5 warnings emitted","code":null,"level":"warning","spans":[],"children":[],"rendered":"\u001b[0m\u001b[1m\u001b[38;5;11mwarning\u001b[0m\u001b[0m\u001b[1m\u001b[38;5;15m: 5 warnings emitted\u001b[0m\n\n"}
|
@ -0,0 +1 @@
|
|||||||
|
f0fa31a79957e157
|
@ -0,0 +1 @@
|
|||||||
|
{"rustc":2347157018072859861,"features":"[]","target":16997346216964277088,"profile":1021633075455700787,"path":1684066648322511884,"deps":[],"local":[{"CheckDepInfo":{"dep_info":"debug\\.fingerprint\\d05-cd6375c08847f9de\\dep-test-bin-d05"}}],"rustflags":[],"metadata":7797948686568424061,"config":2202906307356721367,"compile_kind":0}
|
1
d23/target/debug/d05.d
Normal file
1
d23/target/debug/d05.d
Normal file
@ -0,0 +1 @@
|
|||||||
|
C:\personal\Programmierdaten\rust\advent_of_code\y2022\d23\target\debug\d05.exe: C:\personal\Programmierdaten\rust\advent_of_code\y2022\d23\src\a1.rs C:\personal\Programmierdaten\rust\advent_of_code\y2022\d23\src\a2.rs C:\personal\Programmierdaten\rust\advent_of_code\y2022\d23\src\main.rs
|
BIN
d23/target/debug/d05.exe
Normal file
BIN
d23/target/debug/d05.exe
Normal file
Binary file not shown.
BIN
d23/target/debug/d05.pdb
Normal file
BIN
d23/target/debug/d05.pdb
Normal file
Binary file not shown.
7
d23/target/debug/deps/d05-54bad1502471c435.d
Normal file
7
d23/target/debug/deps/d05-54bad1502471c435.d
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
c:\personal\Programmierdaten\rust\advent_of_code\y2022\d23\target\debug\deps\d05-54bad1502471c435.rmeta: src\main.rs src\a1.rs src\a2.rs
|
||||||
|
|
||||||
|
c:\personal\Programmierdaten\rust\advent_of_code\y2022\d23\target\debug\deps\d05-54bad1502471c435.d: src\main.rs src\a1.rs src\a2.rs
|
||||||
|
|
||||||
|
src\main.rs:
|
||||||
|
src\a1.rs:
|
||||||
|
src\a2.rs:
|
7
d23/target/debug/deps/d05-cd6375c08847f9de.d
Normal file
7
d23/target/debug/deps/d05-cd6375c08847f9de.d
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
c:\personal\Programmierdaten\rust\advent_of_code\y2022\d23\target\debug\deps\d05-cd6375c08847f9de.rmeta: src\main.rs src\a1.rs src\a2.rs
|
||||||
|
|
||||||
|
c:\personal\Programmierdaten\rust\advent_of_code\y2022\d23\target\debug\deps\d05-cd6375c08847f9de.d: src\main.rs src\a1.rs src\a2.rs
|
||||||
|
|
||||||
|
src\main.rs:
|
||||||
|
src\a1.rs:
|
||||||
|
src\a2.rs:
|
7
d23/target/debug/deps/d05.d
Normal file
7
d23/target/debug/deps/d05.d
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
C:\personal\Programmierdaten\rust\advent_of_code\y2022\d23\target\debug\deps\d05.exe: src\main.rs src\a1.rs src\a2.rs
|
||||||
|
|
||||||
|
C:\personal\Programmierdaten\rust\advent_of_code\y2022\d23\target\debug\deps\d05.d: src\main.rs src\a1.rs src\a2.rs
|
||||||
|
|
||||||
|
src\main.rs:
|
||||||
|
src\a1.rs:
|
||||||
|
src\a2.rs:
|
BIN
d23/target/debug/deps/d05.exe
Normal file
BIN
d23/target/debug/deps/d05.exe
Normal file
Binary file not shown.
BIN
d23/target/debug/deps/d05.pdb
Normal file
BIN
d23/target/debug/deps/d05.pdb
Normal file
Binary file not shown.
0
d23/target/debug/deps/libd05-54bad1502471c435.rmeta
Normal file
0
d23/target/debug/deps/libd05-54bad1502471c435.rmeta
Normal file
0
d23/target/debug/deps/libd05-cd6375c08847f9de.rmeta
Normal file
0
d23/target/debug/deps/libd05-cd6375c08847f9de.rmeta
Normal 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.
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user