Add unicode snake printing

Removed a lot of unused and commented code
This commit is contained in:
Uttarayan Mondal
2021-01-24 03:12:13 +05:30
parent c2eff08c9f
commit eeaa8a2675
6 changed files with 110 additions and 68 deletions
+3 -5
View File
@@ -5,11 +5,13 @@ mod menu;
// use game::{Cell, Snake};
// use ncurses::*;
use ncurses::{
curs_set, endwin, getmaxyx, initscr, keypad, noecho, raw, refresh, stdscr, CURSOR_VISIBILITY,
curs_set, endwin, getmaxyx, initscr, keypad, noecho, raw, refresh, setlocale, stdscr,
LcCategory, CURSOR_VISIBILITY,
};
fn main() {
// let (lines, cols): (i32, i32) = (0, 0);
setlocale(LcCategory::all, "");
initscr();
raw();
keypad(stdscr(), true);
@@ -17,10 +19,6 @@ fn main() {
noecho();
let (mut mlines, mut mcols): (i32, i32) = (0, 0);
getmaxyx(stdscr(), &mut mlines, &mut mcols);
// let (mlines, mcols) = match getmaxyx(stdscr()) {
// Ok(size) => (size.lines, size.columns),
// Err(e) => panic!(e),
// };
if (mlines < 20) || (mcols < 35) {
refresh();
endwin();