enter and exit solution editor
This commit is contained in:
parent
44b7d63cde
commit
c4381ac1a1
8 changed files with 195 additions and 41 deletions
|
@ -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 {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue