summaryrefslogtreecommitdiff
path: root/src/main.rs
diff options
context:
space:
mode:
authorOxore <oxore@protonmail.com>2023-07-31 00:22:00 +0300
committerOxore <oxore@protonmail.com>2023-07-31 00:22:00 +0300
commitb92bb10f0169fb47bad6af764886e04e767f4514 (patch)
treebf409b9f0bf6fd6c80a847d759534e98ffa656fb /src/main.rs
parentc665b7dc509e9da5c21c1cedfbb6136b20b61e21 (diff)
Fix initial positions and remove dotted grid
Diffstat (limited to 'src/main.rs')
-rw-r--r--src/main.rs9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/main.rs b/src/main.rs
index e5a8d04..2cf1b23 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -206,7 +206,7 @@ impl Default for Game {
field: Field::default(),
figure: Figure::kind_random(),
x: 3,
- y: 18,
+ y: 17,
fall_timeout: Timeout::from_duration(std::time::Duration::from_millis(500)),
place_timeout: None,
}
@@ -217,7 +217,7 @@ impl Game {
fn place_figure(&mut self) {
self.field.render(&self.figure, self.x, self.y);
self.figure = Figure::kind_random();
- (self.x, self.y) = (3, 18);
+ (self.x, self.y) = (3, 17);
self.stop_place_timeout();
for line in 0..FIELD_ROWS - 1 {
while self.field.is_line_complete(line) {
@@ -322,15 +322,16 @@ impl Game {
fn print_field(field: &Field) {
cursor_to_home();
for y in 0..FIELD_ROWS_VISIBLE {
+ print!("|");
for x in 0..FIELD_COLS {
let c = field.cells[(FIELD_ROWS_VISIBLE - 1 - y) * FIELD_COLS + x];
if c == 0 {
- print!(". ");
+ print!(" ");
} else {
print!("██");
}
}
- print!("\r\x1b[1B");
+ print!("|\r\x1b[1B");
}
}