I made this program to play around with to learn the ncurses libary I'll post it.
Code:
#include <stdio.h>
#include <ncurses.h>
int main (void){
WINDOW * win;
char ch;
int i=1,j=1;
initscr ();
keypad (stdscr,TRUE);
hafedelay (1); */found a better way now just have to learn to fork ()*/
noecho ();
win=newwin(25,25,1,1);
wborder (win,0,0,0,0,0,0,0,0);
wmove(win,i,j);
refresh ();
wrefresh(win);
while(ch != q){
ch=getch ();
switch (ch){
case KEY_DOWN:
i--;
wmove(win,i,j);
refresh ();
wrefresh (win);
break;
case KEY_UP:
i++;
wmove(win,i,j);
refresh ();
wrefresh (win);
break:
}
}
delwin (win);
endwin();
}
this is the code which doesn't work.
(also the text editor I use doesn't for some reson let me copy past into netscape so I wrote it looking at the other code, there may be some typos.)