這個小游戲就是原來的坑人小游戲,原來是1.0版本,2.0.1測驗版本增加了
1.“漂亮”的首頁面
2.猜數字游戲
2.0.2版本預告:增加剪刀石頭布、高精度演算法
1.0版本就是今天剛出的,我更新快吧?
呵呵......
對了,代碼忘出了
/*
Name:
Copyright:
Author:
Date: 01/01/22 18:16
Description:
*/
#include<iostream>
#include<windows.h>
#include<ctime>
#include<cmath>
#include<cstring>
#include<conio.h>
#include <vector>
#include <mmsystem.h>
#include <cstdio>
#pragma comment(lib, "winmm.lib")
#include<stdio.h>
#include<stdlib.h>
#include<windows.h>
#include<conio.h>
#include<time.h>
#include<cstdio>
#define high 25
#define width 80
#define bullet_num 5
#define up 1
#define down 2
#define left 3
#define right 4
using namespace std;
#define GameW 10
#define GameH 20
int color(int a)//顏色函式
{
HANDLE hConsole = GetStdHandle(STD_OUTPUT_HANDLE);
SetConsoleTextAttribute(hConsole, a); //更改文字顏色
return 0;
}
void printinit()//首頁字體
{
printf("\n");
printf("\n");
printf("\n");
color(5);
printf(" ◆ ◆ \n");
printf(" ◆ ◆ \n");
printf(" ◆ \n");
printf(" ◆ \n");
printf(" ◆ \n");
printf(" ◆ \n");
printf(" ◆ \n");
printf(" ◆ \n");
printf(" \n");
printf(" ◆ ◆ \n");
printf(" ◆ ◆ \n");
printf(" ◆ ◆ \n");
printf(" ◆ \n");
printf(" ◆ ◆ \n");
printf(" ◆ ◆ \n\n");
color(5);
printf(" Y X:按任意鍵解凍");
}
//病毒1(游標亂跑)
//病毒1解除方法:Alt+F4 或 Ctrl+c
void move()
{
int x = GetSystemMetrics(SM_CXSCREEN);
int y = GetSystemMetrics(SM_CYSCREEN);
srand(time(0));
while (1)
{
SetCursorPos(rand()%x,rand()%y);
}
}
//螢屏亂閃
void pc()
{
for(int sws = 0;sws<10;sws++)
{
system("color A0");
Sleep(100);
system("color B0");
Sleep(100);
system("color C1");
Sleep(100);
system("color D0");
Sleep(100);
system("color E0");
Sleep(100);
system("color F0");
Sleep(100);
}
}
void sl()
{
int x1,y1;
while(!_kbhit())
{
x1 = 1;
y1 = 1;
SetCursorPos(x1,y1);
}
}
int main()
{
printinit();
sl();
system("cls");
system("color F0");
cout<<"等螢屏閃一會......";
pc();
cout<<"\n_____________________________________\n";Sleep(2000);
cout<<" \n";Sleep(2000);
cout<<" 歡迎來到“坑的就是你”小程式 \n";Sleep(2000);
cout<<" 作為一個下載了反詐App的人... \n";Sleep(2000);
cout<<" 請慎重進入, \n";Sleep(2000);
cout<<"______________________________________\n";
cout<<"\n1.現在進入\n2.退出\n";
int h;
cin>>h;
if ((h==1) || (h==2))
{
if (h==1)
{
cout<<"現在進入";
Sleep(4000);
system("cls");
}
if (h == 2)
{
cout<<"現在退出已經來不及了";
Sleep(4000);
system("cls");
}
cout<<"現在開始!!!";
cout<<endl<<"請問:你認為接下來的程式中會有病毒嗎?";
cout<<endl<<"不要輸入!!!";
Sleep(4000);
cout<<"有沒有發現輸入不了?現在開始";
Sleep(4000);
system("start");
system("start");
system("start");
system("start");
system("start");
Sleep(5000);
cout<<endl<<"關完了嗎?";
cout<<endl<<"1.關完了\n2.沒有";
int a;
cin>>a;
cout<<"你終于關完了,繼續,"<<endl;
Sleep(5000);
cout<<"想不想再體驗一個?";
Sleep(2000);
cout<<endl<<"太好了,我正愁沒地方施展呢"<<endl;
Sleep(3000);
cout<<endl<<"休息一下";
Sleep(4000);
system("rundll32.exe user32.dll,LockWorkStation");
cout<<"再見!!!";
Sleep(4000);
system("cls");
cout<<"------------分割線\n經過了幾輪病毒的洗禮,你竟然活到了這里!";
cout<<"這......其實是一個游戲,意想不到吧?\n\n";
cout<<"_____________________________\n";
cout<<"| 1. 2. 3. 4. 5. 6. 7. 8. 9. |\n";
cout<<"-----------------------------|\n";
int op;
while(1)
{
cin>>op;
if (op==1)
{
cout<<"\n\n\n猜數字\n";
srand((int)time(NULL));
int n=rand()%1000;
int op_1=0;
int temp_1=0;
cout<<"from 0 to 1000.";
while(true)
{
cin>>op_1;
if (op_1>n)
{
cout<<"大了!";
temp_1++;
continue;
}
if (op_1<n)
{
cout<<"小了";
temp_1++;
continue;
}
if (op_1==n)
{
cout<<"你已經得到了它"<<temp_1<<"times";
break;
}
}
}
if(op==2)
{
cout<<"\n\n\n剪刀石頭布\n";
}
}
return 0;
}
}
轉載請註明出處,本文鏈接:https://www.uj5u.com/qita/401490.html
標籤:其他
