实例介绍
#include"stdio.h"
#include"unistd.h"
#include"stdlib.h"
#include"string.h"
#include"curses.h"
#include"time.h"
void shuaxin (void);
int Sleep(unsigned long x);
void shan (void);
void shan2 (void);
int main()
{
int i;
int j;
initscr();
//显示三组文本,每个一秒显示在屏幕上
move(5,10);
attron(A_BOLD);
printw("%s","Mr.xu");
attroff(A_BOLD);
refresh();
sleep(1);
move(8,13);
attron(A_STANDOUT);
attron(A_BOLD);
printw("%s","Do you still remember?");
attroff(A_STANDOUT);
refresh();
sleep(1);
move(10,15);
standout();
printw("%s","The yearning life of childhood:");
shuaxin();
move(11,23);
printw("%s","Has it come true?");
shuaxin();
move(12,15);
printw("%s","The paper plane of childhood:");
shuaxin();
move(13,23);
printw("%s","Where did it fly?");
shuaxin();
move(14,15);
printw("%s","Now what are you hesitating about");
shuaxin();
move(15,23);
printw("%s","Bread or love?");
shuaxin();
move(16,15);
printw("%s","Such a day like this");
shuaxin();
move(17,23);
printw("%s","How long will it take?");
shuaxin();
for(i=0; i<6; i )
{
flash();
Sleep(300);
}
Sleep(500);
move(10,15);
clrtobot();
printw("%s","How are you going to escape!!!");
shan();
move(13,15);
printw("%s","How are you going to escape!!!");
shan();
move(16,15);
printw("%s","How are you going to escape!!!");
shan();
move(19,15);
printw("%s","How are you going to escape!!!");
shan();
move(22,15);
printw("%s","How are you going to escape!!!");
shan();
for(i=0; i<11; i )
{
flash();
Sleep(100);
}
Sleep(500);
clear();
move(8,13);
clrtobot();
printw("%s","NOW ! ! !");
shuaxin();
move(10,15);
printw("%s","Here's a perfect opportunity!");
shuaxin();
move(12,15);
printw("%s","Welcome to Kylin!");
shuaxin();
move(14,15);
printw("%s","Right now, right now!!");
shuaxin();
move(16,15);
printw("%s","Keep away from the construction site!!");
shuaxin();
Sleep(2000);
flash();
clear();
for(j=0; j<20; j )
{
clear();
for(i=0; i<LINES-1; i )
{
move(i,15);
printw("%s","looking forward to your joining");
shan2();
}
}
//将光标移动到屏幕的右下角,然后结束程序
move(LINES -1,COLS -1);
refresh();
Sleep(10000);
endwin();
exit(EXIT_SUCCESS);
}
void shuaxin (void)
{
refresh();
Sleep(3000);
}
void shan (void)
{
flash();
refresh();
Sleep(2000);
}
void shan2 (void)
{
flash();
refresh();
Sleep(100);
}
int Sleep(unsigned long x) //等待函数
{
clock_t c1=clock(),c2;
do
{
if((c2=clock())==(clock_t)-1) //错误
return -1;
}
while(1000.0*(c2-c1)/CLOCKS_PER_SEC<x); //由于c1,c2是无符号整形数乘1000将其转换为浮点数
return 0;
}
#include"unistd.h"
#include"stdlib.h"
#include"string.h"
#include"curses.h"
#include"time.h"
void shuaxin (void);
int Sleep(unsigned long x);
void shan (void);
void shan2 (void);
int main()
{
int i;
int j;
initscr();
//显示三组文本,每个一秒显示在屏幕上
move(5,10);
attron(A_BOLD);
printw("%s","Mr.xu");
attroff(A_BOLD);
refresh();
sleep(1);
move(8,13);
attron(A_STANDOUT);
attron(A_BOLD);
printw("%s","Do you still remember?");
attroff(A_STANDOUT);
refresh();
sleep(1);
move(10,15);
standout();
printw("%s","The yearning life of childhood:");
shuaxin();
move(11,23);
printw("%s","Has it come true?");
shuaxin();
move(12,15);
printw("%s","The paper plane of childhood:");
shuaxin();
move(13,23);
printw("%s","Where did it fly?");
shuaxin();
move(14,15);
printw("%s","Now what are you hesitating about");
shuaxin();
move(15,23);
printw("%s","Bread or love?");
shuaxin();
move(16,15);
printw("%s","Such a day like this");
shuaxin();
move(17,23);
printw("%s","How long will it take?");
shuaxin();
for(i=0; i<6; i )
{
flash();
Sleep(300);
}
Sleep(500);
move(10,15);
clrtobot();
printw("%s","How are you going to escape!!!");
shan();
move(13,15);
printw("%s","How are you going to escape!!!");
shan();
move(16,15);
printw("%s","How are you going to escape!!!");
shan();
move(19,15);
printw("%s","How are you going to escape!!!");
shan();
move(22,15);
printw("%s","How are you going to escape!!!");
shan();
for(i=0; i<11; i )
{
flash();
Sleep(100);
}
Sleep(500);
clear();
move(8,13);
clrtobot();
printw("%s","NOW ! ! !");
shuaxin();
move(10,15);
printw("%s","Here's a perfect opportunity!");
shuaxin();
move(12,15);
printw("%s","Welcome to Kylin!");
shuaxin();
move(14,15);
printw("%s","Right now, right now!!");
shuaxin();
move(16,15);
printw("%s","Keep away from the construction site!!");
shuaxin();
Sleep(2000);
flash();
clear();
for(j=0; j<20; j )
{
clear();
for(i=0; i<LINES-1; i )
{
move(i,15);
printw("%s","looking forward to your joining");
shan2();
}
}
//将光标移动到屏幕的右下角,然后结束程序
move(LINES -1,COLS -1);
refresh();
Sleep(10000);
endwin();
exit(EXIT_SUCCESS);
}
void shuaxin (void)
{
refresh();
Sleep(3000);
}
void shan (void)
{
flash();
refresh();
Sleep(2000);
}
void shan2 (void)
{
flash();
refresh();
Sleep(100);
}
int Sleep(unsigned long x) //等待函数
{
clock_t c1=clock(),c2;
do
{
if((c2=clock())==(clock_t)-1) //错误
return -1;
}
while(1000.0*(c2-c1)/CLOCKS_PER_SEC<x); //由于c1,c2是无符号整形数乘1000将其转换为浮点数
return 0;
}
好例子网口号:伸出你的我的手 — 分享!
小贴士
感谢您为本站写下的评论,您的评论对其它用户来说具有重要的参考价值,所以请认真填写。
- 类似“顶”、“沙发”之类没有营养的文字,对勤劳贡献的楼主来说是令人沮丧的反馈信息。
- 相信您也不想看到一排文字/表情墙,所以请不要反馈意义不大的重复字符,也请尽量不要纯表情的回复。
- 提问之前请再仔细看一遍楼主的说明,或许是您遗漏了。
- 请勿到处挖坑绊人、招贴广告。既占空间让人厌烦,又没人会搭理,于人于己都无利。
关于好例子网
本站旨在为广大IT学习爱好者提供一个非营利性互相学习交流分享平台。本站所有资源都可以被免费获取学习研究。本站资源来自网友分享,对搜索内容的合法性不具有预见性、识别性、控制性,仅供学习研究,请务必在下载后24小时内给予删除,不得用于其他任何用途,否则后果自负。基于互联网的特殊性,平台无法对用户传输的作品、信息、内容的权属或合法性、安全性、合规性、真实性、科学性、完整权、有效性等进行实质审查;无论平台是否已进行审查,用户均应自行承担因其传输的作品、信息、内容而可能或已经产生的侵权或权属纠纷等法律责任。本站所有资源不代表本站的观点或立场,基于网友分享,根据中国法律《信息网络传播权保护条例》第二十二与二十三条之规定,若资源存在侵权或相关问题请联系本站客服人员,点此联系我们。关于更多版权及免责申明参见 版权及免责申明
网友评论
我要评论