You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

28 lines
777 B

  1. <?php
  2. $n=0;
  3. ncurses_init();
  4. if(ncurses_has_colors()){
  5. ncurses_start_color();
  6. ncurses_init_pair(1,NCURSES_COLOR_RED,NCURSES_COLOR_BLACK);
  7. ncurses_init_pair(2,NCURSES_COLOR_GREEN,NCURSES_COLOR_BLACK);
  8. ncurses_init_pair(3,NCURSES_COLOR_YELLOW,NCURSES_COLOR_BLACK);
  9. ncurses_init_pair(4,NCURSES_COLOR_BLUE,NCURSES_COLOR_BLACK);
  10. ncurses_init_pair(5,NCURSES_COLOR_MAGENTA,NCURSES_COLOR_BLACK);
  11. ncurses_init_pair(6,NCURSES_COLOR_CYAN,NCURSES_COLOR_BLACK);
  12. ncurses_init_pair(7,NCURSES_COLOR_WHITE,NCURSES_COLOR_BLACK);
  13. }
  14. while(1){
  15. for ($x=0; $x<80; $x++) {
  16. for ($y=0; $y<24; $y++) {
  17. $n++;
  18. ncurses_move($y,$x);
  19. ncurses_addch($n+64);
  20. ncurses_color_set($n%8);
  21. ncurses_refresh();
  22. if($n>26)$n=0;
  23. }
  24. }
  25. ncurses_getch();
  26. }
  27. ?>