#include /* * hello5.c * bounce a message back and forth across the screen */ main() { char msg[] = " Hello "; /* notice padding spaces */ int dir = +1; initscr(); clear(); int pos = LEFTEDGE; while(1){ move(ROW,pos); addstr( msg ); /* draw it */ move(LINES-1,COLS-1); /* park the cursor */ refresh(); pos += dir; /* advance position */ if ( pos >= RIGHTEDGE ) /* check for bounce */ dir = -1; if ( pos <= LEFTEDGE ) dir = +1; sleep(1); } }