I finnaly got working the program with <ncurses.h> in the virtual box that i put Ubuntu.
A test program for handling the screen is given to us,
this:
#include <ncurses.h>
int main(int argc, char **argv)
{
int X = 10;
int Y = 10;
int ch;
initscr();
noecho();
keypad(stdscr,TRUE);
move(Y, X);
printw("M");
refresh();
do
{
ch = getch();
move(Y, X);
printw(" ");
switch(ch)
{
case KEY_UP: Y--; break;
case KEY_DOWN: Y++; break;
case KEY_LEFT: X--; break;
case KEY_RIGHT: X++; break;
}
move(Y, X);
printw("M");
refresh();
}
while (ch!=27);
endwin();
return 0;
}
//To compile: gcc screen.c -lncurses
but that only moves the letter "M" into the screen with the cursor buttons.
I want the maze in the screen along with the moving "M" but i don't know how that happens...
i don't want or expect to solve the maze for me, i will try it myself
but all i want is to represent the screen along with the moving "M".
Something like this: E-->(exit)
************************************************************
* E
* ********* **** ************ ****************** ********* *
* ********* **** ************ * ********* ********* *
* ********* **** ************ * ****** ********* ********* *
* ********* **** * * ********* ********* *
* ********* ***************** ******** ********* ********* *
* * * *
* ******************* * *** * **************************** *
* ******************* * *** * **************************** *
* ******************* * *** * ** ** *
* ******************* * *** * ************ *************** *
* ********* * * ************ ***** *
* **** **** ********* ******* ************ ***** **** **** *
* **** **** ********* ************ ***** **** **** *
* ****************************** ***** **** **** *
* **** **** * * **** ** *
* **** **** ***************** ****************** ********* *
M *
************************************************************
Plz if anyone know to do that in C just tell me how, i'm lost.
Thanks.