h小游戏
用sleep和cls,可以实现运动这个概念(虽然光标跳来跳去的看起来很low),具体自己脑补。。。
代码:
#include<iOStream>
#include<stdlib.h>
#include<cstdio>
#include<ctime>
#include<windows.h>
#define stop Sleep(2000)
#define CLS system("cls")
using namespace std;
int main(){
int big,time;printf("请输入两个数字,分别代表方块的大小(<=15),移动次数(<=20),按回车键开始。\n");
while(cin>>big>>time){
stop;
CLS;
cout<<"Are you aready , boy ?"<<endl;
stop;
cout<<"1 2 3"<<endl;
Sleep(900);
CLS;
cout<<"Are you aready , boy ?"<<endl;
cout<<"1 2"<<endl;
Sleep(900);
CLS;
cout<<"Are you aready , boy ?"<<endl;
cout<<"1"<<endl;
Sleep(900);
system("cls");
for(int t=0;t<=time;t++){
for(int i=1;i<=big;i++){
for(int j=1;j<=t;j++)cout<<" ";
for(int j=1;j<=big;j++){
cout<<'O'<<' ';
}cout<<endl;
}
Sleep(500);
system("cls");
}
cout<<"Are you have fun ?"<<endl;stop;
cout<<"If you are , press 1 before enter key , and else press 2 . "<<endl;
cout<<"If you press 3 , play again ! "<<endl;
int fun;cin>>fun;stop;
if(fun==1){
cout<<"I'm glad that you are hAPPy like a donky ."<<endl;Sleep(1900);CLS;
cout<<"What did I just say ?"<<endl;stop;
cout<<"Do you know ?"<<endl;stop;
cout<<"I'm sorry . I forgot ."<<endl;stop;
cout<<"So ,"<<endl;stop;
cout<<"Have fun again !"<<endl;stop;
}
else if(fun==2){
cout<<"Nothing so have fun can make you happy ?"<<endl;stop;
cout<<"Maybe try again and you will have fun ."<<endl;stop;
}
else ;
CLS;
printf("请输入两个数字,分别代表方块的大小,移动次数,按回车键开始。\n"); Sleep(1000);
}
}
相关阅读
一、导入aspectjweaver.jar包二、创建一个类,使在执行方法之前之后调用package com.ly.spring.aop.advice; public class AdviceR
按A/T+回车可以实现手动换行
无锁队列的实现 | 酷壳 - CoolShell.cn无锁队列的实现
实现的效果就是 一排图片自动横向滚动,鼠标指向的时候,暂定滚动,鼠标离开,继续滚动 首先看下html代码:随便加入四张图片 <p id="
第一次写,感觉很乱,后面直接上代码吧,代码也有注释,想看思路的朋友可以看前面。有什么建议和意见欢迎砸过来。功能:1、客服需登录进入