diff options
| author | Hartmut Holzgraefe <hholzgra@php.net> | 2001-06-12 21:15:49 +0000 |
|---|---|---|
| committer | Hartmut Holzgraefe <hholzgra@php.net> | 2001-06-12 21:15:49 +0000 |
| commit | 453a4ae985d230e6bba48eb9923fca9d61409099 (patch) | |
| tree | 27aac7eb523b32e140bfc8b9d0991ab2acfab971 /ext/ncurses/example1.php | |
| parent | 0d6661b43646a09a85ed28c721077d496f77a648 (diff) | |
| download | php-git-453a4ae985d230e6bba48eb9923fca9d61409099.tar.gz | |
initial version of ncurses extension,
see example1 for whats possible right now
Diffstat (limited to 'ext/ncurses/example1.php')
| -rw-r--r-- | ext/ncurses/example1.php | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/ext/ncurses/example1.php b/ext/ncurses/example1.php new file mode 100644 index 0000000000..0dc689be39 --- /dev/null +++ b/ext/ncurses/example1.php @@ -0,0 +1,28 @@ +<?php +$n=0; +ncurses_init(); +if(ncurses_has_colors()){ +ncurses_start_color(); + ncurses_init_pair(1,NCURSES_COLOR_RED,NCURSES_COLOR_BLACK); + ncurses_init_pair(2,NCURSES_COLOR_GREEN,NCURSES_COLOR_BLACK); + ncurses_init_pair(3,NCURSES_COLOR_YELLOW,NCURSES_COLOR_BLACK); + ncurses_init_pair(4,NCURSES_COLOR_BLUE,NCURSES_COLOR_BLACK); + ncurses_init_pair(5,NCURSES_COLOR_MAGENTA,NCURSES_COLOR_BLACK); + ncurses_init_pair(6,NCURSES_COLOR_CYAN,NCURSES_COLOR_BLACK); + ncurses_init_pair(7,NCURSES_COLOR_WHITE,NCURSES_COLOR_BLACK); +} +while(1){ +for ($x=0; $x<80; $x++) { +for ($y=0; $y<24; $y++) { + $n++; + ncurses_move($y,$x); + ncurses_addch($n+64); + ncurses_color_set($n%8); + ncurses_refresh(); + if($n>26)$n=0; +} +} +} +ncurses_getch(); +?> + |
