hello4.c 424 B

1234567891011121314151617181920212223242526
  1. /* hello4.c
  2. * purpose show how to use erase, time, and draw for animation
  3. */
  4. #include <stdio.h>
  5. #include <curses.h>
  6. main()
  7. {
  8. int i;
  9. initscr();
  10. clear();
  11. for(i=0; i<LINES; i++ ){
  12. move( i, i+i );
  13. if ( i%2 == 1 )
  14. standout();
  15. addstr("Hello, world");
  16. if ( i%2 == 1 )
  17. standend();
  18. refresh();
  19. sleep(1);
  20. move(i,i+i); /* move back */
  21. addstr(" "); /* erase line */
  22. }
  23. endwin();
  24. }