2018-01-04 00:43:54 +11:00
|
|
|
extern crate crossterm;
|
|
|
|
|
2018-01-07 07:31:14 +11:00
|
|
|
use self::crossterm::terminal_style::*;
|
|
|
|
use self::crossterm::terminal_cursor::*;
|
|
|
|
use self::crossterm::terminal::*;
|
|
|
|
use std::io::{stdin, stdout, Write};
|
2018-01-04 00:43:54 +11:00
|
|
|
|
2018-01-07 07:31:14 +11:00
|
|
|
fn main() {
|
|
|
|
terminal::get().clear(ClearType::All);
|
2018-01-04 00:43:54 +11:00
|
|
|
|
2018-01-07 07:31:14 +11:00
|
|
|
for y in 0..21 {
|
|
|
|
for x in 0..21 {
|
|
|
|
if (x == 0 || y == 0) || (x == 20 || y == 20) {
|
|
|
|
print!("{}", paint("■").with(Color::Red));
|
|
|
|
} else {
|
|
|
|
print!("{}", paint(" ").with(Color::Blue).on(Color::Blue));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
println!();
|
|
|
|
}
|
2018-01-04 00:43:54 +11:00
|
|
|
|
2018-01-07 07:31:14 +11:00
|
|
|
let mut curs = cursor::get();
|
|
|
|
{
|
2018-01-08 01:26:20 +11:00
|
|
|
curs.goto(4, 1).print("@");
|
|
|
|
|
|
|
|
}
|
2018-01-04 00:43:54 +11:00
|
|
|
|
2018-01-08 01:26:20 +11:00
|
|
|
terminal::get().clear(ClearType::UntilNewLine);
|
2018-01-07 07:31:14 +11:00
|
|
|
|
2018-01-08 01:26:20 +11:00
|
|
|
cursor::get().goto(0,30);
|
2018-01-07 07:31:14 +11:00
|
|
|
}
|