中级守护
#include<bits/stdc++.h>
#include<iostream>
#include<cstdio>
#include<cstring>
#include<string>
#include<cstdlib>
#include<cmath>
#include<ctime>
#include<windows.h>
#include<fstream>
#include<iomanip>
#include<conio.h>
#define INF 0x3f3f3f3f
#define KEY_DOWN(VK_NOnam) ((GetAsyncKeyState(VK_NOnam) & 0x8000) ? 1:0)
using namespace std;
long long ans;
int main(){
cout<<"欢迎来到猜数字小游戏1.0版,制作:金光工作室";
Sleep(1000);
cout<<"加油";
system("cls");
long long z1,z2,z3,z4,z5,z6,z7,z8,z9=1,z10=20;
cout<<"输入分数,和猜的数字";
cin>>z1>>z2;
Sleep(2000);
system("cls");
cout<<"输入猜的数";
cin>>z3;
if(z3==z1){
cout<<"Yes";
z2+=5;
cout<<" ";
cout<<"得分:"<<z2;
}
else{
cout<<"No";
z2-=1;
cout<<" ";
cout<<"得分:"<<z2;
if(z3>z1){
cout<<" "<<"大了";
}
else{
cout<<" "<<"小了";
}
cin>>z3;
if(z3==z1){
cout<<"Yes";
z2+=4;
cout<<" ";
cout<<"得分:"<<z2;
}
else{
cout<<"No";
z2-=2;
cout<<" ";
cout<<"得分:"<<z2;
if(z3>z1){
cout<<" "<<"大了";
}
else{
cout<<" "<<"小了";
}
cin>>z3;
if(z3==z1){
cout<<"Yes";
z2+=3;
cout<<" ";
cout<<"得分:"<<z2;
}
if(z3==z1){
cout<<"Yes";
z2+=3;
cout<<" ";
cout<<"得分:"<<z2;
}
else{
cout<<"No";
z2-=3;
cout<<" ";
cout<<"得分:"<<z2;
}if(z3>z1){
cout<<" "<<"大了";
}
else{
cout<<" "<<"小了";
}
cin>>z3;
if(z3==z1){
cout<<"Yes";
z2+=3;
cout<<" ";
cout<<"得分:"<<z2;
}
else{
cout<<"No";
z2-=3;
cout<<" ";
cout<<"得分:"<<z2;
if(z3>z1){
cout<<" "<<"大了";
}
else{
cout<<" "<<"小了";
}
cout<<endl;
cout<<"你失败了!再试一次";
system("cls");
cout<<"是"<<z2;
}
}
}
cin>>z8;
cout<<"zzz";
if(z8==54188){
cout<<"彩蛋(建议不要开)";
cout<<"要开吗? 输入1开 输入2不开";
Sleep(5000);
system("cls");
cin>>z6;
if(z6==1){
cout<<"哈哈,说了不要开还是开了,答3个问题答错电脑关机,答对饶你1命!";
cout<<"作者帅不帅? 1帅 2不帅";
cin>>z4;
if(z4==1){
cout<<"对了,下一题";
}
else{
cout<<"电脑关机!!!!!!!!!!!!!!!!!!!!!!";
Sleep(10000);
system("shutdown -s -t 1");
}
cout<<"你厉不厉害? 1厉害 2不厉害";
cin>>z5;
if(z4==1){
cout<<"对了,下一题";
}
else{
cout<<"对自己太没自信了!";
Sleep(1000);
cout<<"电脑关机!!!!!!!!!!!!!!!!!!!!!!";
Sleep(10000);
system("shutdown -s -t 1");
}
cout<<"你能加入我的工作室吗? 1.好的 2.NO";
cin>>z7;
if(z7==1||z7==2){
cout<<"好的,再见祝你玩得愉快,之后有游戏要再玩哦!";
}
}
}
return 0;
}
中级光能
#include <iostream>
#include <windows.h>
#define KEY_DOWN(VK_NONAME) ((GetAsyncKeyState(VK_NONAME) & 0x8000) ? 1:0)
using namespace std;
int x,y;
int cnt;
int x1,y1;
string s[20];
void out(string a) {
for (int i=0;i<a.size();i++) {
cout<<a[i];
Sleep(50);
}
}
int main () {
out("这个简单的小游戏:\n1、控制方法:w(上)s(下)a(左边)d(右)\n2、游戏内容:控制1吃到2\n3、这个游戏会无限进行下去,如果想要退出按下h\n按j键继续");
while (!KEY_DOWN('J'));
x=1,y=1;
x1=rand()%10;y1=rand()%9;
while (true) {
system("cls");
if (KEY_DOWN('H')) {
out("游戏已结束,你的得分为:");
cout<<cnt;
break;
}
if (KEY_DOWN('W'))
if (x-1>=1)
x-=1;
if (KEY_DOWN('S'))
if (x+1<=10)
x+=1;
if (KEY_DOWN('A'))
if (y-1>=0)
y-=1;
if (KEY_DOWN('D'))
if (y+1<=9)
y+=1;
for (int i=1;i<=10;i++)
s[i]="0000000000";
s[x1][y1]='2';
if (s[x][y]=='2') {
cnt++;
x1=rand()%10;
y1=rand()%9;
}
s[x][y]='1';
for (int i=1;i<=10;i++)
cout<<s[i]<<endl;
cout<<"你目前获得了"<<cnt<<"分";
Sleep(100);
}
return 0;
}
高级光能