enter and exit solution editor

This commit is contained in:
Crispy 2024-10-06 16:00:12 +02:00
parent 44b7d63cde
commit c4381ac1a1
8 changed files with 195 additions and 41 deletions

View file

@ -63,6 +63,17 @@ impl Board {
Board::new(rows)
}
pub fn to_string(&self)->String{
let mut out = String::new();
for row in &self.rows{
for tile in row{
out.push(tile.to_char())
}
out.push('\n');
}
out
}
pub fn new_empty(width: usize, height: usize) -> Self {
let rows = vec![vec![Tile::Blank; width]; height];
Self {