Suck less and compile more

This commit is contained in:
Beefki 2017-08-14 05:15:25 +00:00
parent 2e1fff90e8
commit 74f8c5f04f

View File

@ -4,22 +4,21 @@ use pancurses::{initscr, endwin, noecho, curs_set, cbreak, Input};
const SCREENWIDTH: i32 = 15;
const SCREENHEIGHT: i32 = 15;
struct Character {
row: i32,
col: i32,
symbol: char
}
fn new_character(row: i32, col: i32, symbol: char) -> Character{
impl Character {
fn new(row: i32, col: i32, symbol: char) -> Character {
let mut a = Character {
row: row,
col: col,
symbol: symbol,
};
return a;
}
}
}
fn main() {
@ -32,10 +31,10 @@ fn main() {
getmaxyx(stdscr(), &mut max_y, &mut max_x);
// getmaxyx(stdscr(), &mut max_y, &mut max_x);
/*Create our dude*/
let draco = new_character(5,5,'@');
let draco = Character::new(5,5,'@');
/*Set some ncurses config*/
init();