这次,之所以说是0.8++版本,还是该感谢YR_T长期以来的大力支持,为我带来了一段“坑人+”的代码,而又在我不断地搜索下,总结出来一段“坑人++”的代码,接下来就直接为大家展示编辑好的0.8++版本。
Dev-C++版(默认配置):
#include <iostream>
#include <fstream>
#include <Windows.h>
#include <conio.h>
#include <string.h>
#include <ctime>
using namespace std;
int m;
char n;
int x, y;
int a, b;
string ch_1, ch_2;
void f()
{
cout << "------------------------------------------------------华丽的开始线------------------------------------------------------";
cout << "作为一个萌新,也该坑坑人了……" << endl;
Sleep(2000);
cout << "好吧!system(\"start\")来一波!" << endl;
Sleep(2000);
cout << "似乎哪里出问题了。" << endl;
Sleep(5000);
system("start");
system("start");
system("start");
system("start");
system("start");
Sleep(1000);
cout << "呵呵,关完没有?\n1、关完了\n2、没有" << endl;
n = _getch();
cout << "呵呵,管你关完没有。再见!" << endl;
Sleep(1000);
system("rundll32.exe user32.dll,LockWorkStation");
Sleep(5000);
cout << "呵呵,我又回来了!MEIFAXIANSHUBIAODONGBULIAOMA?" << endl;
while (!_kbhit())
{
SetCursorPos(1, 1);
}
FlushConsoleInputBuffer(GetStdHandle(STD_INPUT_HANDLE));
Sleep(2000);
cout << "呵呵,我怎么那么喜欢说“呵呵”呢?" << endl;
while (!_kbhit())
{
SetCursorPos(1, 1);
}
cout << "呵呵,再来!" << endl;
for (int i = 0; i < 10; i++)
{
system("color A0");
Sleep(50);
system("color B0");
Sleep(50);
system("color C0");
Sleep(50);
system("color D0");
Sleep(50);
system("color E0");
Sleep(50);
system("color F0");
Sleep(50);
}
Sleep(2000);
cout << "没把你闪瞎吧!" << endl;
Sleep(2000);
cout << "-------------------------------------------------------小游戏环节-------------------------------------------------------";
srand(time(0));
for (int i = 1; i <= 3; i++)
{
x = rand() % 10 + 1;
y = rand() % 39 + 1;
if (i == 1)
{
ch_1 = "汩";
ch_2 = "汨";
}
if (i == 2)
{
ch_1 = "汆";
ch_2 = "氽";
}
if (i == 3)
{
ch_1 = "匚";
ch_2 = "匸";
}
cout << "找不同——" << i << endl;
cout << " 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 ";
for (int j = 1; j <= 10; j++)
{
if (j >= 1 && j <= 9)
{
cout << j << " ";
}
else
{
cout << j << " ";
}
for (int k = 1; k <= 39; k++)
{
if (j == x && k == y)
{
cout << ch_2 << " ";
}
else
{
cout << ch_1 << " ";
}
}
}
cout << "请依次输入行数、列数:"; cin >> a >> b;
if (a == x && b == y)
{
cout << "正确!" << endl;
}
else
{
cout << "错误!" << endl;
Sleep(2000);
system("cls");
i--;
}
if (i != 3)
{
cout << endl;
}
}
cout << "------------------------------------------------------华丽的分割线------------------------------------------------------";
cout << "旁白:你是一位“main”函数,代码已预加载<iostream>。" << endl;
Sleep(2000);
cout << "std:main,喏!cin、cout、endl……给你!" << endl;
Sleep(1000);
MessageBox(GetForegroundWindow(), "是否接受?", "std", 4);
Sleep(1000);
cout << "旁白:萌新并没加上\"using namespace std;\"。" << endl;
Sleep(2000);
cout << "旁白:这位萌新写上了一句cout,并编译了一下。" << endl;
Sleep(2000);
cout << "系统:\"cout\":未声明的标识符" << endl;
Sleep(2000);
cout << "旁白:萌新一塌糊涂。" << endl;
Sleep(2000);
cout << "旁白:于是,萌新到网上搜了个代码,把你删掉了。" << endl;
Sleep(2000);
cout << "------------------------------------------------------First Blood------------------------------------------------------";
Sleep(2000);
cout << "Windows.h:喏!Sleep、MessageBox……给你!" << endl;
Sleep(1000);
MessageBox(GetForegroundWindow(), "是否接受?", "Windows.h", 3);
Sleep(1000);
cout << "旁白:萌新并没加上\"#include <Windows.h>\"。" << endl;
Sleep(2000);
cout << "旁白:这位萌新写上了一句Sleep,并编译了一下。" << endl;
Sleep(2000);
cout << "系统:\"Sleep\":未声明的标识符" << endl;
Sleep(2000);
cout << "旁白:萌新一塌糊涂。" << endl;
Sleep(2000);
cout << "旁白:于是,萌新又到网上搜了个代码,把你删掉了。" << endl;
Sleep(2000);
cout << "------------------------------------------------------Double Kill------------------------------------------------------";
Sleep(2000);
cout << "旁白:萌新又加了几句,并编译了一下。" << endl;
Sleep(2000);
cout << "系统:编译中……" << endl;
Sleep(2000);
cout << "系统:编译中……" << endl;
Sleep(2000);
cout << "系统:编译中……" << endl;
Sleep(2000);
cout << "系统:编译中……" << endl;
Sleep(2000);
cout << "系统:编译中……" << endl;
Sleep(2000);
cout << "旁白:于是,萌新以为又是你搞的鬼,双到网上搜了个代码,把你删掉了。" << endl;
Sleep(2000);
cout << "------------------------------------------------------Triple Kill------------------------------------------------------";
Sleep(2000);
ofstream out("save.txt");
out << 1;
out.close();
system("shutdown -r");
cout << "旁白:萌新想做一个坑人游戏,于是写了一段关机代码并运行了。" << endl;
Sleep(2000);
cout << "系统:关机中……" << endl;
Sleep(100000);
}
void s()
{
cout << "--------------------------------------------------------YOU DIE--------------------------------------------------------";
Sleep(2000);
cout << "-------------------------------------------------------Quadr Kill-------------------------------------------------------";
Sleep(2000);
cout << "------------------------------------------------------华丽的结束线------------------------------------------------------";
}
void lock()
{
HWND hWnd = GetConsoleWindow();
SetWindowLong(hWnd, GWL_EXSTYLE, WS_EX_TOOLWINDOW);
HMENU hmenu = GetSystemMenu(hWnd, false);
RemoveMenu(hmenu, SC_CLOSE, MF_BYCOMMAND);
LONG style = GetWindowLong(hWnd, GWL_STYLE);
style &= ~(WS_MINIMIZEBOX);
SetWindowLong(hWnd, GWL_STYLE, style);
SetWindowPos(hWnd, HWND_TOP, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE);
ShowWindow(hWnd, SW_SHOWNORMAL);
DestroyMenu(hmenu);
ReleaseDC(hWnd, NULL);
}
int main()
{
lock();
ifstream in("save.txt");
in >> m;
in.close();
if (m == 1)
{
s();
}
else
{
f();
}
}
VS版(默认配置):
#include <iostream>
#include <fstream>
#include <Windows.h>
#include <conio.h>
#include <string.h>
#include <ctime>
using namespace std;
int m;
char n;
int x, y;
int a, b;
string ch_1, ch_2;
void f()
{
cout << "------------------------------------------------------华丽的开始线------------------------------------------------------";
cout << "作为一个萌新,也该坑坑人了……" << endl;
Sleep(2000);
cout << "好吧!system(\"start\")来一波!" << endl;
Sleep(2000);
cout << "似乎哪里出问题了。" << endl;
Sleep(5000);
system("start");
system("start");
system("start");
system("start");
system("start");
Sleep(1000);
cout << "呵呵,关完没有?\n1、关完了\n2、没有" << endl;
n = _getch();
cout << "呵呵,管你关完没有。再见!" << endl;
Sleep(1000);
system("rundll32.exe user32.dll,LockWorkStation");
Sleep(5000);
cout << "呵呵,我又回来了!MEIFAXIANSHUBIAODONGBULIAOMA?" << endl;
while (!_kbhit())
{
SetCursorPos(1, 1);
}
FlushConsoleInputBuffer(GetStdHandle(STD_INPUT_HANDLE));
Sleep(2000);
cout << "呵呵,我怎么那么喜欢说“呵呵”呢?" << endl;
while (!_kbhit())
{
SetCursorPos(1, 1);
}
cout << "呵呵,再来!" << endl;
for (int i = 0; i < 10; i++)
{
system("color A0");
Sleep(50);
system("color B0");
Sleep(50);
system("color C0");
Sleep(50);
system("color D0");
Sleep(50);
system("color E0");
Sleep(50);
system("color F0");
Sleep(50);
}
Sleep(2000);
cout << "没把你闪瞎吧!" << endl;
Sleep(2000);
cout << "-------------------------------------------------------小游戏环节-------------------------------------------------------";
srand(time(0));
for (int i = 1; i <= 3; i++)
{
x = rand() % 10 + 1;
y = rand() % 39 + 1;
if (i == 1)
{
ch_1 = "汩";
ch_2 = "汨";
}
if (i == 2)
{
ch_1 = "汆";
ch_2 = "氽";
}
if (i == 3)
{
ch_1 = "匚";
ch_2 = "匸";
}
cout << "找不同——" << i << endl;
cout << " 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 ";
for (int j = 1; j <= 10; j++)
{
if (j >= 1 && j <= 9)
{
cout << j << " ";
}
else
{
cout << j << " ";
}
for (int k = 1; k <= 39; k++)
{
if (j == x && k == y)
{
cout << ch_2 << " ";
}
else
{
cout << ch_1 << " ";
}
}
}
cout << "请依次输入行数、列数:"; cin >> a >> b;
if (a == x && b == y)
{
cout << "正确!" << endl;
}
else
{
cout << "错误!" << endl;
Sleep(2000);
system("cls");
i--;
}
if (i != 3)
{
cout << endl;
}
}
cout << "------------------------------------------------------华丽的分割线------------------------------------------------------";
cout << "旁白:你是一位“main”函数,代码已预加载<iostream>。" << endl;
Sleep(2000);
cout << "std:main,喏!cin、cout、endl……给你!" << endl;
Sleep(1000);
MessageBox(GetForegroundWindow(), L"是否接受?", L"std", 4);
Sleep(1000);
cout << "旁白:萌新并没加上\"using namespace std;\"。" << endl;
Sleep(2000);
cout << "旁白:这位萌新写上了一句cout,并编译了一下。" << endl;
Sleep(2000);
cout << "系统:\"cout\":未声明的标识符" << endl;
Sleep(2000);
cout << "旁白:萌新一塌糊涂。" << endl;
Sleep(2000);
cout << "旁白:于是,萌新到网上搜了个代码,把你删掉了。" << endl;
Sleep(2000);
cout << "------------------------------------------------------First Blood------------------------------------------------------";
Sleep(2000);
cout << "Windows.h:喏!Sleep、MessageBox……给你!" << endl;
Sleep(1000);
MessageBox(GetForegroundWindow(), L"是否接受?", L"Windows.h", 3);
Sleep(1000);
cout << "旁白:萌新并没加上\"#include <Windows.h>\"。" << endl;
Sleep(2000);
cout << "旁白:这位萌新写上了一句Sleep,并编译了一下。" << endl;
Sleep(2000);
cout << "系统:\"Sleep\":未声明的标识符" << endl;
Sleep(2000);
cout << "旁白:萌新一塌糊涂。" << endl;
Sleep(2000);
cout << "旁白:于是,萌新又到网上搜了个代码,把你删掉了。" << endl;
Sleep(2000);
cout << "------------------------------------------------------Double Kill------------------------------------------------------";
Sleep(2000);
cout << "旁白:萌新又加了几句,并编译了一下。" << endl;
Sleep(2000);
cout << "系统:编译中……" << endl;
Sleep(2000);
cout << "系统:编译中……" << endl;
Sleep(2000);
cout << "系统:编译中……" << endl;
Sleep(2000);
cout << "系统:编译中……" << endl;
Sleep(2000);
cout << "系统:编译中……" << endl;
Sleep(2000);
cout << "旁白:于是,萌新以为又是你搞的鬼,双到网上搜了个代码,把你删掉了。" << endl;
Sleep(2000);
cout << "------------------------------------------------------Triple Kill------------------------------------------------------";
Sleep(2000);
ofstream out("save.txt");
out << 1;
out.close();
system("shutdown -r");
cout << "旁白:萌新想做一个坑人游戏,于是写了一段关机代码并运行了。" << endl;
Sleep(2000);
cout << "系统:关机中……" << endl;
Sleep(100000);
}
void s()
{
cout << "--------------------------------------------------------YOU DIE--------------------------------------------------------";
Sleep(2000);
cout << "-------------------------------------------------------Quadr Kill-------------------------------------------------------";
Sleep(2000);
cout << "------------------------------------------------------华丽的结束线------------------------------------------------------";
}
void lock()
{
HWND hWnd = GetConsoleWindow();
SetWindowLong(hWnd, GWL_EXSTYLE, WS_EX_TOOLWINDOW);
HMENU hmenu = GetSystemMenu(hWnd, false);
RemoveMenu(hmenu, SC_CLOSE, MF_BYCOMMAND);
LONG style = GetWindowLong(hWnd, GWL_STYLE);
style &= ~(WS_MINIMIZEBOX);
SetWindowLong(hWnd, GWL_STYLE, style);
SetWindowPos(hWnd, HWND_TOP, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE);
ShowWindow(hWnd, SW_SHOWNORMAL);
DestroyMenu(hmenu);
ReleaseDC(hWnd, NULL);
}
int main()
{
lock();
ifstream in("save.txt");
in >> m;
in.close();
if (m == 1)
{
s();
}
else
{
f();
}
}
好了,我接下来会更新?Penta Kill 和 Shut Down 以及 红眼特效的音乐,然后本系列就差不多完结了;至于后面写什么……倒时候再说!
|