2022 rust day 14
This commit is contained in:
parent
e5f0094981
commit
25c441bbf4
|
@ -1,5 +1,4 @@
|
||||||
#![allow(dead_code)]
|
#![allow(dead_code)]
|
||||||
use std::fmt::{Display, Formatter};
|
|
||||||
use regex::Regex;
|
use regex::Regex;
|
||||||
use crate::utils;
|
use crate::utils;
|
||||||
use crate::utils::matrix::Matrix;
|
use crate::utils::matrix::Matrix;
|
||||||
|
@ -18,17 +17,6 @@ pub fn run() -> () {
|
||||||
#[derive(Copy, Clone, PartialEq)]
|
#[derive(Copy, Clone, PartialEq)]
|
||||||
enum Tile { Empty, Rock, Sand }
|
enum Tile { Empty, Rock, Sand }
|
||||||
|
|
||||||
impl Display for Tile {
|
|
||||||
fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
|
|
||||||
match self {
|
|
||||||
Tile::Empty => write!(f, ".")?,
|
|
||||||
Tile::Rock => write!(f, "#")?,
|
|
||||||
Tile::Sand => write!(f, "o")?,
|
|
||||||
};
|
|
||||||
Ok(())
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
fn get_data_bounds(data: &[Vec<(usize, usize)>]) -> (usize, (usize, usize)) {
|
fn get_data_bounds(data: &[Vec<(usize, usize)>]) -> (usize, (usize, usize)) {
|
||||||
data.iter()
|
data.iter()
|
||||||
|
|
Loading…
Reference in a new issue