hello3.c 398 B

1234567891011121314151617181920212223242526
  1. /* hello3.c
  2. * purpose using refresh and sleep for animated effects
  3. * outline initialize, draw stuff, wrap up
  4. */
  5. #include <stdio.h>
  6. #include <curses.h>
  7. main()
  8. {
  9. int i;
  10. initscr();
  11. clear();
  12. for(i=0; i<LINES; i++ ){
  13. clear();
  14. move( i, i+i );
  15. if ( i%2 == 1 )
  16. standout();
  17. addstr("Hello, world");
  18. if ( i%2 == 1 )
  19. standend();
  20. sleep(1);
  21. refresh();
  22. }
  23. endwin();
  24. }