mirror of
https://github.com/coding-horror/basic-computer-games.git
synced 2026-01-17 23:35:51 -08:00
fixed drawing
This commit is contained in:
@@ -9,18 +9,16 @@ impl Needle {
|
||||
pub fn draw(&self, row: u8) {
|
||||
//println!("printing row: {}", row);
|
||||
|
||||
let offset = match self.number {
|
||||
1 => " ",
|
||||
_ => "\t\t\t",
|
||||
};
|
||||
|
||||
let row = row as usize;
|
||||
|
||||
if self.disks.len() >= row {
|
||||
self.disks[row - 1].draw();
|
||||
} else {
|
||||
let offset = " ";
|
||||
|
||||
print!("{offset}");
|
||||
print!("*");
|
||||
print!("{offset} ");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user