- 注册时间
- 2004-8-29
- 最后登录
- 1970-1-1
|
以下是源代码:- #define SIZE 29
- #define LENGTH 15
- #define HEIGHT 3
- #define D_TIME 250
- char danceData[][LENGTH]={
- " o",
- " /|\",
- " */ \\* ",
- " o_",
- " <| *",
- " *>\\ ",
-
- " _o/*",
- " * |",
- " / \\ ",
- " *\o_",
- " / *",
- " <\\ ",
- " _o/*",
- " * |",
- " / \\ ",
- " *\\c/*",
- " )",
- " / > ",
- " *",
- " \\__/c",
- " > \\* ",
- " __/",
- " (o_*",
- " \\* ",
- " \\ /",
- " |",
- " */o\\*",
- " \\_",
- " (",
- " */o\\*",
- " <_",
- " __(",
- " * o|*",
- " /_",
- " __(",
- " * o|*",
- " ___",
- " *\/ >",
- " o|*",
- " *",
- " o|_/",
- " */ \",
- " *",
- " _o|_",
- " * >\",
- " _o/*",
- " * |",
- " / \",
- " *\\o/*",
- " |",
- " / \",
- " c/*",
- " <\",
- " */\\ ",
- " c__",
- " <\ *",
- " */\\ ",
- " c__",
- " /\ *",
- " * /> ",
- " c/*",
- " /(__",
- " * / ",
- " __o/*",
- " * (__",
- " < ",
- " __o_",
- " * / *",
- " <\\ ",
- " *_o_",
- " | *",
- " < \\ ",
- " *_c_*",
- " |",
- " >\\ ",
- " *_c_*",
- " |__",
- " > ",
- " *_c_*",
- " __|__",
- " ",
- " ",
- " *_c_*",
- " __)__",
- " ",
- " *\\c/*",
- " __)__"
- };
- void dance(int x,int y){
- int index,n,det;
- index =0;
- det =1;
- while(Inkey()!=0x1b){
- ClearScreen();
- for(n =0;n< HEIGHT; n++) TextOut(x,y+n*16,danceData[index*HEIGHT+n],0x81);
- Refresh();
- Delay(D_TIME);
- index =index +det;
- if(index ==0||index ==SIZE-1) det =-det;
- else if(rand()%8==0) det =-det;
- }
- }
-
- void main(){
- dance(20,20);
- TextOut(40,30,"By Eastsun",0x41);
- Delay(1000);
- }
复制代码 注意:点击上面的"[Copy to clipboard]"就可以复制源代码了 |
|