NDCC创作团队第二代TORS低配版(怀旧升级版)具有休眠、壁纸颜色更换等功能,具体如下表:
◼:自带 ◻:加装 | TORS-100ms2.0怀旧升级版 | TORS-150ms2.0全新速度版 | TORS-200ms2.0ALLMA-606全新乐享版 | TORS-250ms2.0 ALLMA-606速度畅享版 | TORS-300ms2.0双核旗舰体验领先 | TORS-350ms2.1三核领军版 |
计算机内部结构 | 计算机内部结构 | 计算机内部结构 | 计算机内部结构 | 计算机内部结构 | 计算机内部结构 | 计算机内部结构 |
运算连接器(内核模式) | 单核 | 单核 | 单核 | 单核 | DCS-Dual core system | TCS-Three-core system |
内核数量 | 1 | 1 | 1 | 1 | 2 | 3 |
内核等级 | CPTL-4 | CPTL-5 | CPTL-6 | CPTL-6 | CPTL-6/CPTL-5 | CPTL-7/CPTL-6/CPTL-5 |
内核名称 | DITD-8192 | DITD-8192 | DITD-8192smaller辅ALLMA-606 | DITD-8192smaller辅ALLMA-606 | DITD-8196 | DITD-8197 |
内核算(处理)力 | 10^9+2^4/s | 10^9+2^5/s | 10^9+2^6/s | 10^9+2^6/s | 10^9+2^6+2^5/s | 10^9+2^7+2^6+2^5/s |
计算机功能 | 计算机功能 | 计算机功能 | 计算机功能 | 计算机功能 | 计算机功能 | 计算机功能 |
外部连接 | ◼ | ◼ | ◼ | ◼ | ◼ | ◼ |
内部游戏 | ◼ | ◼ | ◼ | ◼ | ◼ | ◼ |
AI | ◼ | ◼ | ◼ | ◼ | ◼ | ◼ |
AI等级 | AIL2 | AIL2 | AIL2 | AIL2 | AIL2 | 暂未公开 |
AI浏览 | ◼ | ◼ | ◼ | ◼ | ◼ | ◼ |
编译器 | ◻ | ◻ | ◻ | ◻ | ◻ | ◼ |
编译辅助 | ◻ | ◻ | ◻ | ◻ | ◻ | ◼ |
编译器名称 | ◻ | ◻ | ◻ | ◻ | ◻ | ◼ |
可调节性能模式 | ◻ | ◻ | 2种(节能/ALLMA高性能) | 2种(节能/ALLMA高性能) | 3种(节能/ALLMA/双核) | 4种(节能/ALLMA/双核/三核) |
微计算机定时休眠 | ◼ | ◼ | ◼ | ◼ | ◼ | ◼ |
微计算机自适应不定时休眠 | ◻ | ◻ | ◻ | ◻ | ◼ | ◼ |
桌面颜色可调功能 | ◼ | ◼ | ◼ | ◼ | ◼ | ◼ |
彩色显示 | ◼ | ◼ | ◼ | ◼ | ◼ | ◼ |
PCL快速路径查找启动 | ◻ | ◻ | ◻ | ◻ | ◼ | ◼ |
注:PCL快速查找需已有指定路径,具体可查看后期作品或评论留言作者。
代码如下,版权所有,盗权必究!
初始密码:jiumeng
#include<bits/stdc++.h>
#pragma once
#include<iostream>
#include<Windows.h>
using namespace std;
int DITD_8192() {
return 0;
}
void out_70ms(string& s_out_70ms) {
int l1 = s_out_70ms.size();
for (int i = 0; i < l1; i++) {
cout << s_out_70ms[i];
Sleep(50);
}
Sleep(50);
cout << endl;
}
void out_10ms(string& s_out_70ms) {
int l1 = s_out_70ms.size();
for (int i = 0; i < l1; i++) {
cout << s_out_70ms[i];
Sleep(10);
}
Sleep(10);
cout << endl;
}
void setcolor(char str[]) {
if (str == "white")
SetConsoleTextAttribute( GetStdHandle(STD_OUTPUT_HANDLE), FOREGROUND_INTENSITY | 1);
if (str == "lightgrean")
SetConsoleTextAttribute( GetStdHandle(STD_OUTPUT_HANDLE), FOREGROUND_INTENSITY | FOREGROUND_RED);
if (str == "lightyellow")
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), FOREGROUND_INTENSITY | FOREGROUND_RED | FOREGROUND_BLUE);
if (str == "lightyellow" )
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), FOREGROUND_INTENSITY | FOREGROUND_GREEN | FOREGROUND_BLUE);
if (str == "blue")
SetConsoleTextAttribute( GetStdHandle(STD_OUTPUT_HANDLE), FOREGROUND_BLUE);
if (str == "pink")
SetConsoleTextAttribute( GetStdHandle(STD_OUTPUT_HANDLE), FOREGROUND_RED);
if (str == "lightyellow")
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), FOREGROUND_RED | FOREGROUND_BLUE);
if (str == "pink")
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), FOREGROUND_GREEN | FOREGROUND_BLUE);
if (str == "lightgray")
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), FOREGROUND_GREEN | 8);
if (str == "gray")
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 8);
else return;
}
//定义敌人结构 其中最后面Frame代表结构体类型 若不加typedef代表定义的结构体变量
typedef struct Frame {
COORD position[2];
// COORD 是Windows API中定义的一种结构,表示一个字符在控制台屏幕上的坐标。
// 其定义为:
// typedef struct _COORD {
// SHORT X;
// SHORT Y;
// } COORD;
int flag;
} Frame;
class Game {
public:
COORD position[10];
COORD bullet[10];//子弹坐标
Frame enemy[8];//敌人数量
int score;
int rank;//级别,难度
int rankf;//等级标志
string title;
int flag_rank;//等级标志
//构造函数
Game();
//初始化所有 //设定位置
void initPlane();
void initBullet();
void initEnemy();
//填充所有 --画出形状和消失的形状
void drawPlane();
void drawPlaneToNull();
void drawBullet();
void drawBulletToNull();
void drawEnemy();
void drawEnemyToNull();
//执行某一个操作
void Playing();//游戏主循环
void planeMove(char x);//飞机移动
void judgePlane();//判断飞机是否与障碍物重叠
void GameOver();//游戏失败
void Pause();// 该成员函数用来使得游戏暂停
void Shoot();//发射子弹
void bulletMove();//子弹移动
void drawThisBulletToNull(COORD c);//画出失效子弹
void judgeEnemy();//判断子弹是否击中障碍物
void drawThisEnemyToNull(Frame f); //击败的障碍物清空
void enemyMove();//障碍物移动
void printScore();//输出分数
};
//主菜单
int drawMenu();
//隐藏光标
void HideCursor();
void SetPos(int i, int j);//设置光标
COORD random(COORD a, COORD b);//产生随机障碍物位置
void drawFrame(COORD a, COORD b, char row, char col);//画出障碍物
//把第y行,[x1, x2) 之间的坐标填充为 ch
void drawRow(int y, int x1, int x2, char ch);
//把第x列,[y1, y2] 之间的坐标填充为 ch
void drawCol(int x, int y1, int y2, char ch);
// 绘制游戏界面
void drawPlaying();
void drawFrame(Frame frame, char row, char col);//画坠毁后的战机
// 该函数用来判断战机的某一部分是否与障碍物有接触
bool judgeCoordInFrame(Frame frame, COORD spot);
void drawRow(COORD a, COORD b, char ch);
#include<Windows.h>
#include<conio.h>
#include<iostream>
#include<ctime>
#include<string>
using namespace std;
Game::Game() {
// 调用类成员函数来进行初始化
initPlane();
initBullet();
initEnemy();
// 初始化四个int型数据成员,采用赋值的方式进行初始化
// string类型的数据成员title没有进行初始化,因为:
// string本身就是一个标准库类类型,它的类定义中设置了默认构造函数,
// 这些默认构造函数会将对象初始化为合理的默认状态,
// string的默认构造函数会产生空字符串,相当于"" 。
this->score = 0;
rank = 25;
rankf = 25;
flag_rank = 0;
}
void Game::initPlane() {
COORD centren;
centren.X = 39;
centren.Y = 22;
position[0].X = position[5].X = position[7].X = position[9].X = centren.X;
position[1].X = centren.X - 2;
position[2].X = position[6].X = centren.X - 1;
position[3].X = position[8].X = centren.X + 1;
position[4].X = centren.X + 2;
for (int i = 0; i <= 4; i++) {
position[i].Y = centren.Y;
}
for (int i = 6; i <= 8; i++) {
position[i].Y = centren.Y + 1;
}
position[5].Y = centren.Y - 1;
position[9].Y = centren.Y - 2;
// 这个函数体类的代码其实就是为了初始化战机的十个部分的位置,战机的组成如下所示:
// | 5
// | 9
// ***** 12034
// *** 678
// 第一排5个0的坐标依次对应了position[1]position[2]position[0]position[3]position[4]
// 第二排三个0的坐标依次对应了position[6]position[7]position[8]
// 两排0上面的两|的坐标从上往下依次对应了position[5]position[9]
}
void Game::drawPlane() {
for (int i = 0; i < 9; i++) {
SetPos(position[i].X, position[i].Y);
if (i != 5) {
setcolor("yellow");
cout << "*";
} else if (i == 5) {
setcolor("yellow");
cout << "|";
}
}
}
// 这个成员函数通过将战机的每个坐标处输出" "来代替"0"和"|",
// 来达到将战机消除的目的。
void Game::drawPlaneToNull() {
for (int i = 0; i < 9; i++) {
SetPos(position[i].X, position[i].Y);
cout << " ";
}
}
// 该成员函数用来初始化子弹,
// 即将每个子弹的Y坐标初始化为30(bullet[i].Y = 30)来表示子弹处于失效状态
void Game::initBullet() {
for (int i = 0; i < 10; i++) {
bullet[i].Y = 30;
}
}
// 该成员函数用来画出子弹
// 首先检查每颗子弹的有效性,如果子弹有效,则定位到该子弹的坐标处,输出 "^",表示该子弹,
// 如果子弹是无效的,则不绘制
void Game::drawBullet() {
for (int i = 0; i < 10; i++) {
if (bullet[i].Y != 30) {
SetPos(bullet[i].X, bullet[i].Y);
setcolor("blue");
cout << "^";
}
}
}
//子弹失效
void Game::drawBulletToNull() {
for (int i = 0; i < 10; i++)
if (bullet[i].Y != 30) {
SetPos(bullet[i].X, bullet[i].Y + 1);
cout << " ";
}
}
// 这个函数用来初始障碍物的位置,
// 屏幕当中只能同时存在八架障碍物,
// 且每架障碍物用如下结构体Frame来表示,如下所示:
// typedef struct Frame
// {
// COORD position[2];
// int flag;
// }Frame;
COORD random(COORD a, COORD b) {
int x = rand() % (a.X - b.X) + a.X;
int y = rand() % (a.Y - b.Y) + a.Y;
COORD c = { x, y };
return c;
}
void Game::initEnemy() {
COORD a = { 1, 1 };
COORD b = { 45, 15 };
for (int i = 0; i < 8; i++) {
enemy[i].position[0] = random(a, b);
// random(a, b)是调用了一个重载的函数,它表示在坐标a、b之间的矩形框
// 内随机生成一个坐标值,并将该坐标值作为障碍物的左上角的坐标。
// enemy[i].position[0]中是一个Frame结构体类型的变量,存放了障碍物i的左上角的坐标。
enemy[i].position[1].X = enemy[i].position[0].X + 3;
enemy[i].position[1].Y = enemy[i].position[0].Y + 2;
// enemy[i].position[1]也中是一个Frame结构体类型的变量,存放了障碍物i的右下角的坐标。
}
}
// 接下来要根据障碍物的左上角坐标和右下角坐标画出障碍物,
// 显然,障碍物的外形如下所示:
// --
// | |
// --
void Game::drawEnemy() {
for (int i = 0; i < 8; i++) {
setcolor("gray");
drawFrame(enemy[i].position[0], enemy[i].position[1], '-', '|');
}
}
// 将障碍物消除,通过输出空白的方式
void Game::drawEnemyToNull() {
for (int i = 0; i < 8; i++) {
drawFrame(enemy[i].position[0], enemy[i].position[1], ' ', ' ');
}
}
//隐藏光标
void HideCursor() {
CONSOLE_CURSOR_INFO cursor_info = { 1, 0 }; //第二个值0表示隐藏光标
SetConsoleCursorInfo(GetStdHandle(STD_OUTPUT_HANDLE), &cursor_info);
}
void SetPos(int i, int j) { //设置坐标点位(光标)
HANDLE hout;
COORD coord;
coord.X = i;
coord.Y = j;
hout = GetStdHandle(STD_OUTPUT_HANDLE);
SetConsoleCursorPosition(hout, coord);
}
//左上角坐标、右下角坐标、用row填充行、用col填充列
void drawFrame(COORD a, COORD b, char row, char col) {
drawRow(a.Y, a.X + 1, b.X - 1, row);
drawRow(b.Y, a.X + 1, b.X - 1, row);
drawCol(a.X, a.Y + 1, b.Y - 1, col);
drawCol(b.X, a.Y + 1, b.Y - 1, col);
}
//把第y行,[x1, x2) 之间的坐标填充为 ch
void drawRow(int y, int x1, int x2, char ch) {
SetPos(x1, y);
for (int i = 0; i <= (x2 - x1); i++) {
cout << ch;
}
}
//把第x列,[y1, y2] 之间的坐标填充为 ch
void drawCol(int x, int y1, int y2, char ch) {
int y = y1;
while (y != y2 + 1) {
SetPos(x, y);
cout << ch;
y++;
}
}
//主菜单绘制
int drawMenu() {
setcolor("lightgreen");
system("Title TORS 飞 机 大 战");
SetPos(30, 1);
cout << "飞 机 大 战";
drawRow(3, 0, 79, '-');
drawRow(5, 0, 79, '-');
SetPos(28, 4);
setcolor("red");
cout << "↑和↓选择,回车确定";
int j = 11;
SetPos(12, j);
cout << ">>";
SetPos(15, 11);
cout << "1. 简单的任务";
SetPos(15, 13);
cout << "2. 困难的任务";
drawRow(20, 0, 79, '-');
SetPos(47, 11);
setcolor("yellow");
cout << "简单的任务:";
SetPos(51, 13);
cout << "简单任务的自动飞行速度较慢,任务难度较小。 ";
SetPos(30, 21);
setcolor("lightblue");
cout << "纳米核心";
setcolor("red");
drawRow(22, 0, 79, '-');
while (true) {
if (_kbhit()) {
char x = _getch();
switch (x) {
case 72: {
if (j == 13) {
SetPos(12, j);
cout << " ";
j = 11;
SetPos(12, j);
setcolor("red");
cout << ">>";
SetPos(51, 13);
cout << " ";
SetPos(47, 11);
setcolor("yellow");
cout << "简单的任务:";
SetPos(51, 13);
cout << "简单任务的自动飞行速度较慢,任务难度较小。 ";
}
break;
}
case 80: {
if (j == 11)
{
SetPos(12, j);
cout << " ";
j = 13;
SetPos(12, j);
setcolor("red");
cout << ">>";
SetPos(51, 13);
cout << " ";
SetPos(47, 11);
setcolor("yellow");
cout << "困难的任务:";
SetPos(51, 13);
cout << "困难任务自动飞行速度较快,难操作哟! ";
}
break;
}
case 13: { //回车键:13
if (j == 11)//源代码为8?
return 1;
else
return 2;
}
}
}
}
return 0;
}
void drawFrame(int x1, int y1, int x2, int y2, char row, char col) {
COORD a = { x1, y1 };
COORD b = { x2, y2 };
drawFrame(a, b, row, col);
}
// 绘制游戏界面
void drawPlaying() {
setcolor("red");
drawFrame(0, 0, 48, 24, '=', '|');// draw map frame主界面
drawFrame(49, 0, 82, 4, '-', '|');// draw output frame 状态界面
drawFrame(49, 4, 82, 9, '-', '|');// draw score frame 分数界面
drawFrame(49, 9, 82, 20, '-', '|');// draw operate frame 操作界面
drawFrame(49, 20, 82, 24, '-', '|'); // draw other message frame 提示界面
setcolor("yellow") ;
SetPos(61, 2);
cout << "飞只因大战" ;
SetPos(52, 6);
cout << "得分:";
SetPos(52, 7);
cout << "称号:";
SetPos(52, 11);
setcolor("yellow") ;
cout << "操作方式:";
SetPos(52, 13);
cout << "↑,↓,←,→可以控制战机移动。";
SetPos(52, 15);
cout << "P和E分别可以暂停游戏或退出游戏。";
SetPos(52, 17);
cout << "空格可以发射GG弹";
SetPos(52, 19);
cout << "你的任务是躲避障碍物并击毁它们!";
SetPos(52, 22);
setcolor("lightblue") ;
cout << " 游戏虽好玩,不要贪多哦 ";
}
// 该成员函数用过响应战机的一个动作
// ↑,↓,←,→,来控制战机的移动
//上:38,下:40,左:37,右:39;
void Game::planeMove(char x) {
if (x == 75) {
if (position[1].X != 1) {
for (int i = 0; i <= 9; i++) {
position[i].X -= 2;
}
}
}
// 如果玩家按下 ← 键,说明玩家想让战机往左移动一个距离(2个单位),
// 首先检测,战机的最左侧的位置坐标(即position[1].X)有没有达到左边界,
// 如果到达了边界,那就不做出移动;如果没有达到边界,则将战机10个部分的X值减小2。
if (x == 80) {
if (position[7].Y != 23) {
for (int i = 0; i <= 9; i++) {
position[i].Y += 1;
}
}
}
// 如果玩家按下↓ 键,说明玩家想让战机往下移动一个距离(1个单位),
// 首先检测,战机的最底部的位置坐标(即position[6].Y或者position[7].Y或者position[8].Y)有没有达到下边界,
// 如果到达了边界,那就不做出移动;如果没有达到边界,则将战机10个部分的Y值增加1。
if (x == 77 && (position[4].X != 47)) {
for (int i = 0; i <= 9; i++) {
position[i].X += 2;
}
}
// 如果玩家按下 → 键,说明玩家想让战机往右移动一个距离(2个单位),
// 首先检测,战机的最右侧的位置坐标(即position[4].X)有没有达到右边界,
// 如果到达了边界,那就不做出移动;如果没有达到边界,则将战机10个部分的X值增加2。
if (x == 72 && (position[5].Y != 3)) {
for (int i = 0; i <= 9; i++) {
position[i].Y -= 1;
}
}
// 如果玩家按下↑键,说明玩家想让战机往上移动一个距离(1个单位),
// 首先检测,战机的最顶部的位置坐标(即position[5].Y)有没有达到上边界,
// 如果到达了边界,那就不做出移动;如果没有达到边界,则将战机10个部分的Y值减少1。
}
// 该函数用来判断战机的某一部分是否与障碍物有接触
// 如果与障碍物有接触在判断为坠毁
bool judgeCoordInFrame(Frame frame, COORD spot) {
if ((spot.X >= frame.position[0].X) && (spot.X <= frame.position[1].X) && (spot.Y >= frame.position[0].Y) && (spot.Y <= frame.position[1].Y)) {
return true;
}
return false;
}
void drawFrame(Frame frame, char row, char col) {
COORD a = frame.position[0];
COORD b = frame.position[1];
drawFrame(a, b, row, col);
}
//游戏结束
void Game::GameOver() {
setcolor("lightgreen");
system("cls");
COORD p1 = { 28, 9 };
COORD p2 = { 53, 15 };
drawFrame(p1, p2, '=', '|');
SetPos(36, 12);
string str = "Game Over!";
for (int i = 0; i < str.size(); i++) {
Sleep(80);
cout << str[i];
}
Sleep(1000);
system("cls");
drawFrame(p1, p2, '=', '|');
SetPos(31, 11);
setcolor("blue");
cout << "击毁障碍物:" << score / 5 << "个";
SetPos(31, 12);
cout << "得 分:" << score;
SetPos(31, 13);
cout << "获得称号:" << title;
cout << endl;
if (score <= 500) {
cout << "亚希拉林,真的是太逊了,才得几分就坠了" << endl;
}
SetPos(30, 18);
Sleep(1000);
setcolor("green");
cout << "继续? 是(Y)| 否(N)";
as://goto 语句标签 直接跳转至此
char x = _getch();
if (x == 'n' || x == 'N') {
system("cls");
return;
} else if (x == 'y' || x == 'Y') {
system("cls");
Game game;
int a = drawMenu(); // 绘制游戏开始界面主菜单
if (a == 2)
game.rank = 20;
system("cls");
drawPlaying(); // 绘制游戏界面框架
game.Playing();
} else
goto as;
}
// 该成员函数用来判断战机是否坠毁,
// 依次判断每架障碍物与战机的每个部分是否有接触,
// 如果有接触,则表示战机坠毁
void Game::judgePlane() {
for (int i = 0; i < 8; i++) {
for (int j = 0; j < 9; j++)
// 此处的实参position[j]是指战机的10个部分的COORD坐标,
// 类中的成员函数可以访问数据成员变量。
// 此处也可以写成this-> position[j],因为
// 成员函数具有一个附加的隐含形参,即指向该类对象的一个指针,
// 这个隐含形参命名为this,与调用成员函数的对象绑定在一起。
// 成员函数不能定义this形参,而是由编译器隐含地定义。
// 成员函数的函数体可以显式使用this指针,但不是必须这么做。
if (judgeCoordInFrame(enemy[i], position[j])) {
SetPos(61, 2);
cout << " 坠毁 ";
setcolor("yellow");
drawFrame(enemy[i], '+', '+');
// 将与战机相撞的障碍物的形状绘制为:
// ++
// + +
// ++
Sleep(1000);
GameOver();
break;
}
}
}
// 该成员函数用来使得游戏暂停
void Game::Pause() {
SetPos(61, 2);
cout << " ";
SetPos(61, 2);
cout << "暂停中... ";
// 当出现"暂停中..."的提示以后,程序不停的接收按下的按键,
// 当按下'p'键以后,说明要退出暂停状态,此时需要清除"暂停中..."的提示
// 通过输出空白 " "来将其覆盖,达到效果
char c = _getch();
while (c != 'p') {
c = _getch();
}
SetPos(61, 2);
cout << " ";
setcolor("green");
SetPos(61, 2);
cout << "飞机大战";
}
// 这个成员函数用来响应一次射击操作,
// 也就是,当游戏中的时候,玩家按下"k"键,就执行该函数。
// 由于子弹是由COORD bullet[10]定义的,因此同一时刻,界面内只能有10颗子弹同时出现。
// 如果界面内不够10颗子弹,按下"k"键后战机应该发射出一颗子弹,
// 于是,依次遍历10颗子弹,当遇到第一颗失效的子弹后,
// 立即将该子弹赋予新的坐标(战机的炮口,也就是(position[5].X,position[5].Y - 1)),
// 让其激活。然后退出for循环,函数执行完毕。
void Game::Shoot() {
for (int i = 0; i < 10; i++) {
if (bullet[i].Y == 30) {
bullet[i].X = position[5].X;
bullet[i].Y = position[5].Y - 1;
break;
}
}
}
void Game::drawThisBulletToNull(COORD c) {
SetPos(c.X, c.Y);
cout << " ";
}
// 此成员函数用来响应一次子弹的运动
// 每次子弹运动,屏幕子弹的坐标都会出现变化,即
// 先判断子弹是否有效(即判断语句if (bullet[i].Y != 30)),
// 若子弹有效,将该子弹的Y坐标减少1,X坐标不变,
// 检测子弹坐标更改之后是否达到上边界,如果达到上边界,则将该子弹从屏幕上擦除,
// 同时,将该子弹置为失效状态,即 bullet[i].Y = 30。
void Game::bulletMove() {
for (int i = 0; i < 10; i++) {
if (bullet[i].Y != 30) {
bullet[i].Y -= 1;
if (bullet[i].Y == 1) {
COORD pos = { bullet[i].X, bullet[i].Y + 1 };
drawThisBulletToNull(pos);
bullet[i].Y = 30;
}
}
}
}
//击败的障碍物清空
void Game::drawThisEnemyToNull(Frame f) {
drawFrame(f, ' ', ' ');
}
// 该成员函数依次遍历每一架障碍物障碍物,
// 将每一架障碍物依次与每一颗子弹进行检测,
// 判断障碍物是否与子弹有接触,如果有接触,则表示击中障碍物,
// 此时将障碍物和子弹擦除,然后在界面顶部的位置处随机生成一架障碍物
void Game::judgeEnemy() {
for (int i = 0; i < 8; i++) {
for (int j = 0; j < 10; j++) {
if (judgeCoordInFrame(enemy[i], bullet[j])) {
score += 5;
drawThisEnemyToNull(enemy[i]);
COORD a = { 1, 1 };
COORD b = { 45, 3 };
enemy[i].position[0] = random(a, b);
enemy[i].position[1].X = enemy[i].position[0].X + 3;
enemy[i].position[1].Y = enemy[i].position[0].Y + 2;
drawThisBulletToNull(bullet[j]);
bullet[j].Y = 30;
}
}
}
}
// 该成员函数用来响应一次障碍物的移动
// 界面上必须同时出现八架障碍物,因此,
// 如果有某架障碍物运动到下边界处,则重置该障碍物的坐标
void Game::enemyMove() {
for (int i = 0; i < 8; i++) {
for (int j = 0; j < 2; j++)
enemy[i].position[j].Y++;
// 我们将每架障碍物的左上角和右下角坐标的Y值增加1,
// 表示该障碍物向下走了一个距离
// 检测向下走一个距离后的障碍物的右下角坐标的Y值是否达到24,
// 如果达到,代表障碍物已经运动到下边界了,
// 此时需要随机重置该障碍物的坐标
if (enemy[i].position[1].Y == 24) {
COORD a = { 1, 1 };
COORD b = { 45, 3 };
enemy[i].position[0] = random(a, b);
enemy[i].position[1].X = enemy[i].position[0].X + 3;
enemy[i].position[1].Y = enemy[i].position[0].Y + 2;
}
}
}
void Game::printScore() {
if (score <= 100) {
flag_rank = 1;
} else if (score > 300 && score <= 420) {
flag_rank = 2;
} else if (score > 420 && score <= 700) {
flag_rank = 3;
} else if (score > 700 && score <= 1000) {
flag_rank = 4;
} else if (score > 1000) {
flag_rank = 5;
}
SetPos(60, 6);
cout << score;
SetPos(60, 7);
if (flag_rank == 1) {
title = "废物飞行员";
} else if (flag_rank == 2) {
title = "辣鸡飞行员";
} else if (flag_rank == 3) {
title = "勉强飞行员";
} else if (flag_rank == 4) {
title = "牛啤飞行员";
} else if (flag_rank == 5) {
title = "泰裤辣飞行员";
}
cout << title;
}
// 这个成员函数是游戏的主循环函数,
// 定义了整个游戏过程。
void Game::Playing() {
drawEnemy();
drawPlane();
int flag_bullet = 0;
int flag_enemy = 0;
while (true) {
Sleep(20);
// 函数名:kbhit()(VC++6.0下为_kbhit())
// 功能及返回值: 检查当前是否有键盘输入,若有则返回一个非0值,否则返回0
// 用法:int kbhit(void);
// 包含头文件: include <conio.h>
// kbhit()在执行时,检测是否有按键按下,有按下返回非0值,没有按下则返回0,是非阻塞函数;
// 不同于getch()的在执行时, 检测按下什么键, 如果不按键该函数不返回,也就不进行下一步操作,是阻塞函数。
if (_kbhit()) {
char x = _getch();
// getch()是编程中所用的函数,这个函数是一个不回显函数,
// 当用户按下某个字符时,函数自动读取,无需按回车
// getch()并非标准C中的函数,不存在C语言中。
// 所在头文件是conio.h,而不是stdio.h。
// 用ch = getch(); 会等待你按下任意键之后,把该键字符所对应的ASCII码赋给ch, 再执行下面的语句。
if (75 == x || 80 == x || 77 == x || 72 == x) {
drawPlaneToNull(); // 将战机先擦除
planeMove(x); // 根据所输入的操作符,对战机的坐标进行更改
drawPlane(); // 访问类中的数据成员——战机的坐标,在新的坐标处重新绘制战机
judgePlane(); // 判断战机是否有坠毁
}
// 在某一循环当中,如果检测到有'p'键按下,
// 首先在右侧游戏界面输出"暂停中...",然后陷入while()循环一直等待'p'键再次按下,
// 如果'p'键没有按下,就一直处在while()循环内,因此不能执行后面的程序,起到暂停的效果。
else if ('p' == x) {
Pause();
}
// 如果是检测到空格键按下,则运行Shoot()函数,
else if (32 == x) {
Shoot();
}
// 如果是检测到'k'键按下,则运行GameOver()函数,
// GameOver()函数执行完毕后,执行break;语句跳出while循环(注意不是if (_kbhit()))。
// break语句用于结束最近的while、do while、for或switch语句,并将程序的执行权传递给紧接在
// 被终止语句之后的语句。
else if ('e' == x) {
//CloseHandle(MFUN)
GameOver();
break;
}
}
// 接下来处理子弹
// 判断子弹状态的程序一直在运行
if (flag_bullet == 0) {
bulletMove(); // 更新界面上有效子弹的坐标
drawBulletToNull(); // 将处于旧坐标的子弹擦除
drawBullet(); // 绘制出新坐标上的子弹
judgeEnemy(); // 判断障碍物是否被子弹击中
}
flag_bullet++;
if (flag_bullet == 1) {
flag_bullet = 0;
}
// 接下来处理障碍物
if (flag_enemy == 0) {
drawEnemyToNull(); // 将所有的障碍物都擦除
enemyMove(); // 更新障碍物的坐标
drawEnemy(); // 绘制出处于新坐标上的障碍物
judgePlane(); // 判断障碍物是否与战机接触
}
flag_enemy++;
if (flag_enemy >= rank) {
flag_enemy = 0;
}
/* 输出得分 */
printScore();
}
}
void jiafa() {
int q = 0;
int a[100];
int p;
string s = "TORS:请注意,任何参与运算数不要超过10^9+10";
out_10ms(s);
cout << "请输入你要几位数相加" << endl;
cin >> p;
for (int i = 0; i < p; i++) {
cin >> a[i];
};
cout << "开始计算了哈" << endl;
for (int i = 0; i < p; i++) {
q = q + a[i];
};
cout << "结果是" << q << endl;
}
void jianfayunsaun() {
string s = "TORS:请注意,任何参与运算数不要超过10^9+10";
out_10ms(s);
cout << "你想让谁做被减数" << endl;
int a;
cin >> a;
cout << "你想减谁" << endl;
int b;
cin >> b;
int sum = a - b;
cout << "结果是" << sum << endl;
}
void runnian() {
int nian;
int p = 0;
string s1 = "TORS:请注意,任何参与运算数不要超过10^9+10";
out_10ms(s1);
cout << "想判断某年是什么年就输入你想查的那一年" << endl;
cin >> nian;
if (nian % 4 == 0) {
cout << "今年是闰年" << endl; //就是简单的if else
} else {
cout << "今年不是闰年" << endl;
}
}
void syuan() {
double pi = 3.14;
long long r;
double s = 0;
string s1 = "TORS:请注意,任何参与运算数不要超过10^9+10";
out_10ms(s1);
cout << "请输入你要求的圆的半径" << endl; //好像比加法还简单
cin >> r;
s = r * r * pi;
cout << "圆的面积是" << s << endl;
}
void jishuhe() {
int n;
int a = 0;
string s = "TORS:请注意,任何参与运算数不要超过10^9+10";
out_10ms(s);
cout << "输入n的值" << endl;
cin >> n;
for (int i = 1; i <= n; i++) {
if (i % 2 == 1) { //奇数和还有偶数和是一样的我只要从1到我输入的数之间的数都算进去,把符合的加上就好了
a += i;
}
}
cout << "前N项和" << a << endl;
}
void oushuhe() {
int n;
int a = 0;
string s = "TORS:请注意,任何参与运算数不要超过10^9+10";
out_10ms(s);
cout << "输入n的值" << endl;
cin >> n;
for (int i = 2; i <= n; i++) { //和上边的那个一样啊
if (i % 2 == 0) {
a += i;
}
}
cout << "前N项和" << a << endl;
}
void dao1_3beishu() {
int a;
int q = 1;
string s = "TORS:请注意,任何参与运算数不要超过10^9+10";
out_10ms(s);
cout << "请输入一个数" << endl;
cin >> a;
do {
if (q % 3 == 0) {
cout << " " << q << endl;
};
q++;
} while (q <= a);
}
void bei3he5zhengchushu() {
int a;
int b;
string s = "TORS:请注意,任何参与运算数不要超过10^9+10";
out_10ms(s);
cout << "请输入两个数" << endl;
cin >> a;
cin >> b;
int i = a + 1;
do {
int p = i % 3;
int q = i % 5;
if (p == 0 && q == 0) {
cout << i << endl;
break;
};
i++;
} while (i < b); //不可以a < b < c 不然会a < i变成1,从而使得无线循环
}
void shuixanhuashu() {
int p;
string s = "TORS:请注意,任何参与运算数不要超过10^9+10";
out_10ms(s);
cout << "请输入一个数(可以输出这个数之前的水仙花数)" << endl;
cin >> p;
int n = 0;
do {
int a = n % 10;
int b = n % 100 / 10;
int c = n / 100; //只要会判断水仙花数把输入的数从一到n都算是和前边一样用if判断出来就行了
if (n == a * a * a + b * b * b + c * c * c) {
cout << n << endl;
}
n++;
} while (n < p);
}
void panduan() {
int a;
int b;
string s = "TORS:请注意,任何参与运算数不要超过10^9+10";
out_10ms(s);
cout << "请输入两个数" << endl;
cin >> a;
cin >> b;
if (a > b) {
cout << "最大值是" << a << endl; //这个题emmmm。。很一般很一般
} else {
cout << "最大值是" << b << endl;
}
}
void maopao() {
int arr[100];
string s = "TORS:请注意,任何参与运算数不要超过10^9+10";
out_10ms(s);
cout << "请输入10个数字" << endl;
for (int i = 0; i < 10; i++) {
cin >> arr[i];
};
cout << "排序前的数字" << endl;
for (int i = 0; i < 9; i++) {
cout << arr[i] << " ";
}
cout << endl;
for (int i = 0; i < 9 - 1; i++) {
for (int j = 0; j < 9 - i - 1; j++) { //这个就是我第一次去时老师测吧,不难哈
if (arr[j] > arr[j + 1]) {
int temp = arr[j];
arr[j] = arr[j + 1];
arr[j + 1] = temp;
}
}
}
cout << "排序后" << endl;
for (int j = 0; j < 9; j++) {
cout << arr[j] << " ";
}
cout << endl;
}
void juzhenzhuanzhi() {
int a[3][4];
string s = "TORS:请注意,任何参与运算数不要超过10^9+10";
out_10ms(s);
for (int i = 0; i < 3; i++) {
for (int j = 0; j < 4; j++) { // 这个最核心的思想是要把他的行列互换搞清楚就简单了
cin >> a[i][j];
}
};
for (int i = 0; i < 4; i++) {
for (int j = 0; j < 3; j++) {
cout << a[j][i] << " ";
};
cout << "\n" << endl;
};
}
void qiuduijiaoxianhe() {
int a[3][3];
string s = "TORS:请注意,任何参与运算数不要超过10^9+10";
out_10ms(s);
cout << "请输入数字以进行下一步" << endl; //我好像没啥好办法,直接让他们相加了
for (int i = 0; i < 3; i++) {
cin >> a[0][i];
};
cout << endl;
for (int i = 0; i < 3; i++) {
cin >> a[1][i];
};
for (int i = 0; i < 3; i++) {
cin >> a[2][i];
};
int p = a[0][0] + a[1][1] + a[2][2];
cout << "相加后的结果是" << p << endl;
}
void tongjidanci() {
char a[100];
string s = "TORS:请注意,任何参与运算数不要超过10^9+10";
out_10ms(s);
cout << "请输入几个单词" << endl;
gets(a);
int sum = 0;
for (int i = 0; a[i] != '\0'; i++) {
if (a[i] != ' ' && (a[i + 1] == ' ' || a[i + 1] == '\0')) //这个主要是没学啊,我在网上学的,不过他们都是C,我用的C++
//开始介绍思想,就是明白后面会有一个\0作为系统自己加上的结束符号就解决了这道问题,可你之前没交,但测试的有着道题
{
sum++;
}
}
cout << sum << endl;
}
void chengfayunsuan() {
int a[100];
int q;
int p = 1;
string s = "TORS:请注意,任何参与运算数不要超过10^9+10";
out_10ms(s);
cout << "你要让几位数相乘" << endl;
cin >> q;
cout << "请输入你要他们相乘的数" << endl; //就是乘法啥的和前边的加法啥的一样简单哈
for (int i = 0; i < q; i++) {
cin >> a[i];
};
for (int i = 0; i < q; i++) {
p *= a[i];
};
cout << "结果是" << p << endl;
}
void chufayunsuan() {
string s = "TORS:请注意,任何参与运算数不要超过10^9+10";
out_10ms(s);
cout << "你想让谁做被除数" << endl;
int a;
cin >> a;
cout << "你想让谁做除数" << endl;
int b;
cin >> b;
int sum = a / b;
cout << "结果是" << sum << endl;
}
char board[16][16], o;
void init() {
for (int i = 0; i <= 15; i++)
for (int j = 0; j <= 15; j++)
board[i][j] = '-';
for (int i = 1; i <= 15; i++) board[0][i] = i + 64;
for (int j = 1; j <= 15; j++) board[j][0] = j + 64;
board[0][0] = '*';
}
void display() {
cout << " ================================" << endl;
for (int i = 0; i <= 15; i++) {
cout << "|";
for (int j = 0; j <= 15; j++)
cout << board[i][j] << " ";
cout << "|" << endl;
}
cout << " ================================" << endl;
}
void place(bool color) {
string colour;
char x, y;
x = y = ' ';
system("cls");
display();
if (!color) colour = "黑";
if (color) colour = "白";
cout << colour << "方放置棋子,请输入棋子的行和列(大写字母):";
cin >> x >> y;
if (x - 64 > 16 || y - 64 > 16 || x - 64 < 1 || y - 64 < 1) {
cout << "该位置超出棋盘范围,请重新放置!" << x << y << endl;
system("pause");
place(color);
}
if (board[x - 64][y - 64] == 'b' || board[x - 64][y - 64] == 'w') {
cout << "该位置已有棋子" << board[x - 64][y - 64] << ",请重新放置!" << endl;
system("pause");
place(color);
} else {
if (!color) board[x - 64][y - 64] = 'b';
if (color) board[x - 64][y - 64] = 'w';
}
}
int compute() {
int num;
for (int i = 1; i <= 15; i++)
for (int j = 1; j <= 15; j++)
if (board[i][j] == 'b' || board[i][j] == 'w') num++;
if (num == 225) return 2;
for (int i = 1; i <= 15; i++)
for (int j = 1; j <= 15; j++) {
if (board[i][j] == 'b' && board[i][j] == board[i + 1][j] && board[i][j] == board[i + 2][j] && board[i][j] == board[i + 3][j] && board[i][j] == board[i + 4][j]) return 0;
if (board[i][j] == 'w' && board[i][j] == board[i + 1][j] && board[i][j] == board[i + 2][j] && board[i][j] == board[i + 3][j] && board[i][j] == board[i + 4][j]) return 1;
if (board[i][j] == 'b' && board[i][j] == board[i][j + 1] && board[i][j] == board[i][j + 2] && board[i][j] == board[i][j + 3] && board[i][j] == board[i][j + 4]) return 0;
if (board[i][j] == 'w' && board[i][j] == board[i][j + 1] && board[i][j] == board[i][j + 2] && board[i][j] == board[i][j + 3] && board[i][j] == board[i][j + 4]) return 1;
if (board[i][j] == 'b' && board[i][j] == board[i + 1][j + 1] && board[i][j] == board[i + 2][j + 2] && board[i][j] == board[i + 3][j + 3] && board[i][j] == board[i + 4][j + 4]) return 0;
if (board[i][j] == 'w' && board[i][j] == board[i + 1][j + 1] && board[i][j] == board[i + 2][j + 2] && board[i][j] == board[i + 3][j + 3] && board[i][j] == board[i + 4][j + 4]) return 1;
if (board[i][j] == 'b' && board[i][j] == board[i - 1][j + 1] && board[i][j] == board[i - 2][j + 2] && board[i][j] == board[i - 3][j + 3] && board[i][j] == board[i - 4][j + 4]) return 0;
if (board[i][j] == 'w' && board[i][j] == board[i - 1][j + 1] && board[i][j] == board[i - 2][j + 2] && board[i][j] == board[i - 3][j + 3] && board[i][j] == board[i - 4][j + 4]) return 1;
}
}
void bidaxiao() {
int a;
int b;
cout << "请输入两个数" << endl;
cin >> a;
cin >> b;
if (a > b) {
cout << "最大值是" << a << endl;
} else {
cout << "最大值是" << b << endl;
}
}
void xueshengpaixu() {
struct student {
string name;
int sno;
int score;
};
student student[10];
cout << "请输入学生姓名 学号 成绩" << endl;
for (int i = 0; i < 10; i++) {
cout << "请输入第" << i + 1 << "个学生的信息: ";
cin >> student[i].name >> student[i].sno >> student[i].score; //就麻烦点吧,要记住一体的属性前要加上这个属性所属的个体,不难
};
for (int i = 0; i < 9; i++) {
for (int j = 0; j < 9 - i; j++) {
if (student[j].score > student[j].score) { //平平无奇的冒泡排序
struct student temp = student[j];
student[j] = student[j + 1];
student[j + 1] = student[j];
};
};
} ;
for (int i = 0; i < 10; i++) {
cout << "第" << i + 1 << "个学生的名字是:" << student[i].name << " 第" << i + 1 << "个学生的学号是:" << student[i].sno << " 第" << i + 1 << "个学生的成绩是:" << student[i].score << endl;
};
int sum = 0;
for (int i = 0; i < 10; i++) {
sum += student[i].score;
};
int ave = sum / 10;
cout << "学生的平均成绩是" << sum << endl;
}
clock_t start,end;
int main() {
int bianyifuzhu = 0, AI = 0, waibulianjie = 0, bianyiqi = 0;
int shuimian = 0;
while (shuimian == 0) {
int xingneng = 2;
system("Title TORS MAIN");
string c, n, t;
int m, o, i = 1, p;
string s = "jiumeng";
cout << "正在与本地计算机连接" << endl;
cout << "Connecting to the local computer" << endl;
Sleep(500);
string c1 = "■■■■■■■■■■" ;
string s2 = "■■■■■■■■■■■■■■■■■■■■■■■■■■■■■";
out_70ms(c1);
system("cls");
cout << "与本地计算机连接成功" << endl;
cout << "Connecting to the local computer" << endl;
cout << "输入密码" << endl;
while(c!=s)
{
int llkl=3;
llkl--;
getline(cin, c);
system("cls");
if(c!=s) cout<<"密码错误,您还有"<<llkl<<"次机会";
}
if (c == s) {
string ccc = "低功率睡眠模式已启动";
cout << "正在进行身份验证";
out_70ms(c1);
system("cls");
cout << "The authentication passed" << endl;
cout << "Welcome TORS computer" << endl;
Sleep(500);
system("cls");
system("color F");
cout << "■■■■ ■■■■■■ SSSSS 2.0 怀旧升级版" << endl;
cout << " ■ ■ ■ ■ S" << endl;
cout << " ■ ■ ■■■ SSS" << endl;
cout << " ■ ■ ■ ■ S" << endl;
cout << " ■ ■■■■ ■■SSSSS" << endl;
system("color A");
Sleep(200);
system("color B");
Sleep(200);
system("color C");
Sleep(100);
system("color D");
Sleep(150);
system("color E");
Sleep(200);
system("color F");
Sleep(1000);
xingneng = 2;
int shuimian1;
while (i != 0) {
if (xingneng == 1) {
system("color 08");
}
if (shuimian1 == 1) {
system("cls");
shuimian1 = 0;
system("color F");
cout << "■■■■ ■■■■■■ SSSSS 2.0 怀旧升级版" << endl;
cout << " ■ ■ ■ ■ S" << endl;
cout << " ■ ■ ■■■ SSS" << endl;
cout << " ■ ■ ■ ■ S" << endl;
cout << " ■ ■■■■ ■■SSSSS" << endl;
system("color A");
Sleep(200);
system("color B");
Sleep(200);
system("color C");
Sleep(100);
system("color D");
Sleep(150);
system("color E");
Sleep(200);
system("color F");
Sleep(100);
cout << "系统已恢复";
Sleep(1000);
}
system("cls");
if (xingneng = 1) cout << "DITD-8192:系统提醒,在低频率使用时,建议您开启'低功率睡眠模式',以降低CPU占用率,是否立刻开启(0:关闭 1:开启)注:该版本仅支持1分钟睡眠" << endl;
cin >> shuimian;
if(shuimian>1)
{
cout<<"该版本不支持此选项";
continue;
}
if (shuimian != 0) {
system("cls");
xingneng = 1;
system("color 08");
cout<<"DITD-8192:";
out_70ms(ccc);
cout << "■■■■ ■■■■■■ SSSSS DITD-8192:睡眠中" << endl;
cout << " ■ ■ ■ ■ S" << endl;
cout << " ■ ■ ■■■ SSS" << endl;
cout << " ■ ■ ■ ■ S" << endl;
cout << " ■ ■■■■ ■■SSSSS" << endl;
if(shuimian==1) Sleep(60000);
shuimian = 0;
shuimian1++;
continue;
}
system("cls");
char v;
cout << "按'v'键回车查询用户手册,输入T继续并启用AI" << endl;
cin >> v;
cout << endl;
if (bianyifuzhu == 1) {
cout << "ALLMA-606:编译辅助功能已介入TORS使用,加速器开始运行" << endl;
system("pause");
}
if (v == 'v') {
cout << "TORS(SPACE 2代 100ms )用户指导手册" << endl;
cout << "1.使用时仅限TORS高配可使ALLMA-606超运算核心"<< endl;
cout << "2.计算器模式仅限10^9以内计算,否则会溢出,若需高精度计算,请升级更高版本!" << endl;
cout << "3.该版本互动模式ACTIVE内容尚有缺陷,使用时会导致关闭根目录,请注意适当使用!" << endl;
cout << "4.请勿随意更改源码,可能造成内部崩溃!" << endl;
cout << "5.2308款第2代TORS更新了AI使用以及编译环境,适当添加了部分辅助使用系统,在原有基础上升级了计算速度与计算范围" << endl;
cout << "由张翼德老师提供亿点点技术支持" << endl;
system("PAUSE");
} else if (v == 'T') {
if (AI == 0) {
cout << "尚未开启AI功能,请前往设置开启" << endl;
system("pause");
} else if (AI == 1) {
if (v == 'T') {
cout << "你好,我是小T,有什么可以帮到你的吗?" << endl;
while (v != 0) {
string iii;
cin >> iii;
if (iii == "no") {
cout << "好的,再见!";
Sleep(200);
break;
}
if (iii == "start_bilibili") {
cout << "即将为您打开哔哩哔哩,请稍后";
system("start https://www.bilibili.com/");
continue;
} else if (iii == "start_baidu") {
cout << "即将为您打开百度,请稍后";
system("start https://www.baidu.com/");
continue;
} else if (iii == "start_crazygames") {
cout << "即将为您打开crazy games,请稍后";
system("start https://www.crazygames.com/");
continue;
} else if (iii == "start_yinghuadongman") {
cout << "即将为您打开樱花动漫,请稍后";
system("start http://yhdm86.com/");
continue;
} else if (iii == "start_wzoi") {
cout << "即将为您打开WZOI,请稍后";
system("start https://wzoi.cc/");
continue;
}
if (iii == "start_csdn") {
cout << "即将为您打开CSDN,请稍后";
system("start https://www.csdn.net/");
continue;
} else if (iii == "C++") {
system("start https://oj.ipachong.com");
continue;
} else cout << "这超出了我的理解范围,您可以试着对我说:start_baidu(意为打开百度)";
}
}
}
system("cls");
out_10ms(s2);
cout << "桌面" << endl;
cout << " " << "1.多功能计算器" << " " << endl;
cout << " " << "2.飞只因大战" << " " << endl;
cout << " " << "3.关机" << " " << endl;
cout << " " << "4.输出c++基本框架" << " " << endl;
cout << " " << "5.c++例题提取身份信息源代码" << " " << endl;
cout << " " << "6.双人五子棋" << " " << endl;
cout << " " << "7.设置" << endl;
cout << " " << "8.MC(PCL版1.16.2)启动器" << endl;
out_10ms(s2);
cin >> m;
if (m == 8) {
cout<<"当前配置不足以运行 MC 标签页,推荐您使用双核及以上版本"<<enld;
system("pause");
}
if (m == 7) {
int mmnn;
out_10ms(s2);
cout << "设置" << endl;
cout << " " << "1.编译辅助功能" << " " << endl;
cout << " " << "2.AI使用状态" << " " << endl;
cout << " " << "3.外部连接" << " " << endl;
cout << " " << "4.编译器开启/关闭(即将推出)" << " " << endl;
cout << " " << "5.桌面颜色" << " " << endl;
cout << " " << "6.性能调节" << " " << endl;
cout << " " << "7.返回" << endl;
out_10ms(s2);
cin >> mmnn;
if (mmnn == 7) {
}
if (mmnn == 5) {
if(xingneng==1)
{
cout<<"当前为节能状态,无法使用此功能,您可更改性能至 单核使用模式 以启用该功能!";
continue;
}
cout << "请输入窗口颜色(use English)" << endl;
string www;
string zzz;
cin >> www;
if (www == "black") {
//TORC生产(?00100001010001001001?)
cout << "请输入字体颜色";
cin >> zzz;
while (true) {
if (zzz == www) {
cout << "DITD-8192:警告,您所选的字体颜色与背景颜色一致,可能影响您的正常使用使用,请更改字体颜色" << endl;
cin >> zzz;
} else {
break;
}
}
if (zzz == "black") {
system("color 00");
}
if (zzz == "blue") {
system("color 01");
}
if (zzz == "green") {
system("color 02");
}
if (zzz == "green1") {
system("color 03");
}
if (zzz == "white") {
system("color 07");
}
if (zzz == "white1") {
system("color 0F");
}
if (zzz == "yellow1") {
system("color 0E");
}
if (zzz == "yellow") {
system("color 06");
}
if (zzz == "purple") {
system("color 0D");
}
}
if (www == "blue") {
//TORC生产(?00100001010001001001?)
cout << "请输入字体颜色";
cin >> zzz;
while (true) {
if (zzz == www) {
cout << "DITD-8192:警告,您所选的字体颜色与背景颜色一致,可能影响您的正常使用使用,请更改字体颜色" << endl;
}
cin >> zzz;
if (zzz != www) {
break;
}
}
if (zzz == "black") {
system("color 10");
}
if (zzz == "blue") {
system("color 11");
}
if (zzz == "green") {
system("color 12");
}
if (zzz == "green1") {
system("color 13");
}
if (zzz == "white") {
system("color 17");
}
if (zzz == "white1") {
system("color 1F");
}
if (zzz == "yellow1") {
system("color 1E");
}
if (zzz == "yellow") {
system("color 16");
}
if (zzz == "purple") {
system("color 1D");
}
}
if (www == "green") {
//TORC生产(?00100001010001001001?)
cout << "请输入字体颜色";
cin >> zzz;
while (true) {
if (zzz == www) {
cout << "DITD-8192:警告,您所选的字体颜色与背景颜色一致,可能影响您的正常使用使用,请更改字体颜色" << endl;
cin >> zzz;
}
if (zzz != www) {
break;
}
}
if (zzz == "black") {
system("color 20");
}
if (zzz == "blue") {
system("color 21");
}
if (zzz == "green") {
system("color 22");
}
if (zzz == "green1") {
system("color 23");
}
if (zzz == "white") {
system("color 27");
}
if (zzz == "white1") {
system("color 2F");
}
if (zzz == "yellow1") {
system("color 2E");
}
if (zzz == "yellow") {
system("color 26");
}
if (zzz == "purple") {
system("color 2D");
}
}
if (www == "green1") {
//TORC生产(?00100001010001001001?)
cout << "请输入字体颜色";
cin >> zzz;
while (true) {
if (zzz == www) {
cout << "DITD-8192:警告,您所选的字体颜色与背景颜色一致,可能影响您的正常使用使用,请更改字体颜色" << endl;
cin >> zzz;
}
if (zzz != www) {
break;
}
}
if (zzz == "black") {
system("color 30");
}
if (zzz == "blue") {
system("color 31");
}
if (zzz == "green") {
system("color 32");
}
if (zzz == "green1") {
system("color 33");
}
if (zzz == "white") {
system("color 37");
}
if (zzz == "white1") {
system("color 3F");
}
if (zzz == "yellow1") {
system("color 3E");
}
if (zzz == "yellow") {
system("color 36");
}
if (zzz == "purple") {
system("color 3D");
}
}
if (www == "white") {
//TORC生产(?00100001010001001001?)
cout << "请输入字体颜色";
cin >> zzz;
while (true) {
if (zzz == www) {
cout << "DITD-8192:警告,您所选的字体颜色与背景颜色一致,可能影响您的正常使用使用,请更改字体颜色" << endl;
cin >> zzz;
}
if (zzz != www) {
break;
}
}
if (zzz == "black") {
system("color 70");
}
if (zzz == "blue") {
system("color 71");
}
if (zzz == "green") {
system("color 72");
}
if (zzz == "green1") {
system("color 73");
}
if (zzz == "white") {
system("color 77");
}
if (zzz == "white1") {
system("color 7F");
}
if (zzz == "yellow1") {
system("color 7E");
}
if (zzz == "yellow") {
system("color 76");
}
if (zzz == "purple") {
system("color 7D");
}
}
if (www == "white1") {
//TORC生产(?00100001010001001001?)
cout << "请输入字体颜色";
cin >> zzz;
while (true) {
if (zzz == www) {
cout << "DITD-8192:警告,您所选的字体颜色与背景颜色一致,可能影响您的正常使用使用,请更改字体颜色" << endl;
cin >> zzz;
}
if (zzz != www) {
break;
}
}
if (zzz == "black") {
system("color F0");
}
if (zzz == "blue") {
system("color F1");
}
if (zzz == "green") {
system("color F2");
}
if (zzz == "green1") {
system("color F3");
}
if (zzz == "white") {
system("color F7");
}
if (zzz == "white1") {
system("color FF");
}
if (zzz == "yellow1") {
system("color FE");
}
if (zzz == "yellow") {
system("color F6");
}
if (zzz == "purple") {
system("color FD");
}
}
if (www == "yellow1") {
//TORC生产(?00100001010001001001?)
cout << "请输入字体颜色";
cin >> zzz;
while (true) {
if (zzz == www) {
cout << "DITD-8192:警告,您所选的字体颜色与背景颜色一致,可能影响您的正常使用使用,请更改字体颜色" << endl;
cin >> zzz;
}
if (zzz != www) {
break;
}
}
if (zzz == "black") {
system("color E0");
}
if (zzz == "blue") {
system("color E1");
}
if (zzz == "green") {
system("color E2");
}
if (zzz == "green1") {
system("color E3");
}
if (zzz == "white") {
system("color E7");
}
if (zzz == "white1") {
system("color EF");
}
if (zzz == "yellow1") {
system("color EE");
}
if (zzz == "yellow") {
system("color E6");
}
if (zzz == "purple") {
system("color ED");
}
}
if (www == "yellow") {
//TORC生产(?00100001010001001001?)
cout << "请输入字体颜色";
cin >> zzz;
while (true) {
if (zzz == www) {
cout << "DITD-8192:警告,您所选的字体颜色与背景颜色一致,可能影响您的正常使用使用,请更改字体颜色" << endl;
cin >> zzz;
}
if (zzz != www) {
break;
}
}
if (zzz == "black") {
system("color 60");
}
if (zzz == "blue") {
system("color 61");
}
if (zzz == "green") {
system("color 62");
}
if (zzz == "green1") {
system("color 63");
}
if (zzz == "white") {
system("color 67");
}
if (zzz == "white1") {
system("color 6F");
}
if (zzz == "yellow1") {
system("color 6E");
}
if (zzz == "yellow") {
system("color 66");
}
if (zzz == "purple") {
system("color 6D");
}
}
}
if (mmnn == 1) {
if (bianyifuzhu == 0) {
cout << "当前编译辅助功能为 关闭 状态,是否开启?1开0关" << endl;
cin >> bianyifuzhu;
if (bianyifuzhu == 1) {
cout << "好的,已开启编译辅助功能" << endl;
}
if (bianyifuzhu == 0) {
cout << "当前仍为 关闭 状态" << endl;
}
}
else if (bianyifuzhu == 1) {
cout << "当前编译辅助功能为 开启 状态,是否关闭?1开0关" << endl;
cin >> bianyifuzhu;
if (bianyifuzhu == 0) {
cout << "好的,已关闭编译辅助功能" << endl;
}
if (bianyifuzhu == 1) {
cout << "当前仍为 开启 状态" << endl;
}
}
}
if (mmnn == 2) {
if (AI == 0) {
cout << "当前AI为 关闭 状态,是否开启?1开0关" << endl;
cin >> AI;
if (AI == 1) {
cout << "好的,已开启AI功能" << endl;
}
if (AI == 0) {
cout << "当前仍为 关闭 状态" << endl;
}
}
else if (AI == 1) {
cout << "当前AI为 开启 状态,是否关闭?1开0关" << endl;
cin >> AI;
if (AI == 0) {
cout << "已关闭AI功能" << endl;
}
if (AI == 1) {
cout << "当前仍为 开启 状态" << endl;
}
}
}
if (mmnn == 3) {
cout << "该版本没有此功能";
system("pause");
}
if (mmnn == 4) {
cout<<"暂不支持此功能";
system("pause");
}
if (mmnn == 6) {
cout << "该版本没有此功能";
system("pause");
}
}
if (m == 1) {
system("cls");
out_10ms(s2);
cout << "多功能计算器" << endl;
cout << " " << "1.加法运算" << " " << endl;
cout << " " << "2.减法运算" << " " << endl;
cout << " " << "3.判断闰年" << " " << endl;
cout << " " << "4.计算圆的面积" << " " << endl;
cout << " " << "5.计算从1到输入数之间的奇数和" << " " << endl;
cout << " " << "6.计算从1到输入数之间的偶数和" << " " << endl;
cout << " " << "7.输出从1到输入数之间所有3的倍数" << endl;
cout << " " << "8.求即被3整除有被5整除的数" << " " << endl;
cout << " " << "9.求水仙花数" << " " << endl;
cout << " " << "10.比较大小" << " " << endl;
cout << " " << "11.冒泡排序" << " " << endl;
cout << " " << "12.矩阵转置" << " " << endl;
cout << " " << "13.求对角线的和" << " " << endl;
cout << " " << "14.统计单词个数" << " " << endl;
cout << " " << "15.乘法运算" << " " << endl;
cout << " " << "16.除法运算" << " " << endl;
cout << " " << "17.比较两个数的大小" << " " << endl;
cout << " " << "18.结构体排序是个学生的成绩,并求平均值" << " " << endl;
out_10ms(s2);
int a;
cin >> a;
switch (a) {
case 1: {
jiafa();
cout << "输入1重复此操作,输入2结束程序" << endl;
int b;
cin >> b;
switch (b) {
case 1: {
jiafa() ;
break;
};
case 2: {
cout << "感谢使用,单击任意键结束此程序" << endl;
break;
};
};
break;
};
case 2: {
jianfayunsaun();
cout << "输入1重复此操作,输入2结束程序" << endl;
int b;
cin >> b;
switch (b) {
case 1: {
jianfayunsaun() ;
break;
};
case 2: {
cout << "感谢使用,单击任意键结束此程序" << endl;
break;
};
};
break;
};
case 3: {
runnian();
cout << "输入1重复此操作,输入2结束程序" << endl;
int b;
cin >> b;
switch (b) {
case 1: {
runnian() ;
break;
};
case 2: {
cout << "感谢使用,单击任意键结束此程序" << endl;
break;
};
};
break;
};
case 4: {
syuan();
cout << "输入1重复此操作,输入2结束程序" << endl;
int b;
cin >> b;
switch (b) {
case 1: {
syuan() ;
break;
};
case 2: {
cout << "感谢使用,单击任意键结束此程序" << endl;
break;
};
};
break;
};
case 5: {
jishuhe();
cout << "输入1重复此操作,输入2结束程序" << endl;
int b;
cin >> b;
switch (b) {
case 1: {
jishuhe() ;
break;
};
case 2: {
cout << "感谢使用,单击任意键结束此程序" << endl;
break;
};
};
break;
};
case 6: {
oushuhe();
cout << "输入1重复此操作,输入2结束程序" << endl;
int b;
cin >> b;
switch (b) {
case 1: {
oushuhe() ;
break;
};
case 2: {
cout << "感谢使用,单击任意键结束此程序" << endl;
break;
};
};
break;
};
case 7: {
dao1_3beishu();
cout << "输入1重复此操作,输入2结束程序" << endl;
int b;
cin >> b;
switch (b) {
case 1: {
dao1_3beishu() ;
break;
};
case 2: {
cout << "感谢使用,单击任意键结束此程序" << endl;
break;
};
};
break;
};
case 8: {
bei3he5zhengchushu();
cout << "输入1重复此操作,输入2结束程序" << endl;
int b;
cin >> b;
switch (b) {
case 1: {
bei3he5zhengchushu() ;
break;
};
case 2: {
cout << "感谢使用,单击任意键结束此程序" << endl;
break;
};
};
break;
};
case 9: {
shuixanhuashu();
cout << "输入1重复此操作,输入2结束程序" << endl;
int b;
cin >> b;
switch (b) {
case 1: {
shuixanhuashu() ;
break;
};
case 2: {
cout << "感谢使用,单击任意键结束此程序" << endl;
break;
};
};
break;
};
case 10: {
panduan();
cout << "输入1重复此操作,输入2结束程序" << endl;
int b;
cin >> b;
switch (b) {
case 1: {
panduan() ;
break;
};
case 2: {
cout << "感谢使用,单击任意键结束此程序" << endl;
break;
};
};
break;
};
case 11: {
maopao();
cout << "输入1重复此操作,输入2结束程序" << endl;
int b;
cin >> b;
switch (b) {
case 1: {
maopao() ;
break;
};
case 2: {
cout << "感谢使用,单击任意键结束此程序" << endl;
break;
};
};
break;
};
case 12: {
juzhenzhuanzhi();
cout << "输入1重复此操作,输入2结束程序" << endl;
int b;
cin >> b;
switch (b) {
case 1: {
juzhenzhuanzhi() ;
break;
};
case 2: {
cout << "感谢使用,单击任意键结束此程序" << endl;
break;
};
};
break;
};
case 13: {
qiuduijiaoxianhe();
cout << "输入1重复此操作,输入2结束程序" << endl;
int b;
cin >> b;
switch (b) {
case 1: {
qiuduijiaoxianhe() ;
break;
};
case 2: {
cout << "感谢使用,单击任意键结束此程序" << endl;
break;
};
};
break;
};
case 14: {
tongjidanci();
cout << "输入1重复此操作,输入2结束程序" << endl;
int b;
cin >> b;
switch (b) {
case 1: {
tongjidanci() ;
break;
};
case 2: {
cout << "感谢使用,单击任意键结束此程序" << endl;
break;
};
};
break;
};
case 15: {
chengfayunsuan();
cout << "输入1重复此操作,输入2结束程序" << endl;
int b;
cin >> b;
switch (b) {
case 1: {
chengfayunsuan() ;
break;
};
case 2: {
cout << "感谢使用,单击任意键结束此程序" << endl;
break;
};
};
break;
};
case 16: {
chufayunsuan();
cout << "输入1重复此操作,输入2结束程序" << endl;
int b;
cin >> b;
switch (b) {
case 1: {
chufayunsuan() ;
break;
};
case 2: {
cout << "感谢使用,单击任意键结束此程序" << endl;
break;
};
};
break;
};
case 17: {
bidaxiao();
cout << "输入1重复此操作,输入2结束程序" << endl;
int b;
cin >> b;
switch (b) {
case 1: {
bidaxiao() ;
break;
};
case 2: {
cout << "感谢使用,单击任意键结束此程序" << endl;
break;
};
};
break;
};
case 18: {
xueshengpaixu();
cout << "输入1重复此操作,输入2结束程序" << endl;
int b;
cin >> b;
switch (b) {
case 1: {
xueshengpaixu() ;
break;
};
case 2: {
cout << "感谢使用,单击任意键结束此程序" << endl;
break;
};
};
break;
};
default: {
cout << "请输入1到18中间的数字" << endl;
break;
}
}
}
if (m == 2) {
system("PAUSE");
cout << "\t\t****飞机大战游戏正在准备****\n";
cout << "\n已加载 0%"; //7
for (int i = 0; i < 9; i++) {
SetPos((i + 1) * 2 - 1, 1);
cout << "■ ";
SetPos(7 - 1, 3 - 1);
cout << i + 1;
Sleep(200);
}
Sleep(200);
SetPos(19, 1);
cout << "■ \n已加载100%";
Sleep(200);
system("cls");
srand((unsigned int)time(NULL));//随机时间种子
HideCursor();//隐藏光标
Game game;
HideCursor();
int a = drawMenu();
if (a == 2) {
game.rank = 20;
}
system("cls");
HideCursor();
drawPlaying();
HideCursor();
game.Playing();
}
if (m == 3) {
cout << "程序终止/computer off" << endl;
system("PAUSE");
return 0;
}
if (m == 4) {
cout << "开始输入" << endl;
string s11 = "#include<bits/stdc++.h>";
string s22 = "using namespace std;";
string s33 = "int main(){";
string s44 = " return 0;";
string s55 = "}";
int i = 0;
while (i <= 0) {
out_70ms(s11);
out_70ms(s22);
out_70ms(s33);
out_70ms(s44);
out_70ms(s55);
system("pause");
i++;
}
}
if (m == 5) {
cout << "开始输入" << endl;
string s1 = "#include<bits/stdc++.h>";
string s2 = "using namespace std;";
string s3 = "int main(){";
string s4 = " string c;";
string s5 = " getline(cin,c);";
string s6 = " cout<<“Birthday is” ;";
string s7 = " if(c[10]=='0') cout<<c[11]<<“/”;";
string s8 = " else cout<<c[10]<<c[11]<<“/”;";
string s9 = " if(c[12]=='0') cout<<c[13];";
string s10 = " else cout<<c[12]<<c[13];";
string s11 = " return 0;";
string s12 = "}";
int i = 0;
while (i <= 0) {
out_70ms(s1);
out_70ms(s2);
out_70ms(s3);
out_70ms(s4);
out_70ms(s5);
out_70ms(s6);
out_70ms(s7);
out_70ms(s8);
out_70ms(s9);
out_70ms(s10);
out_70ms(s11);
out_70ms(s12);
i++;
system("pause");
}
}
if (m == 6) {
game_start:
init();
system("cls");
system("title 双人五子棋");
cout << "双人五子棋小游戏" << endl;
cout << "小提示:棋盘中b代表黑方(black),w代表白方(white)" << endl;
cout << "请按任意键开始游戏......";
getch();
while (true) {
place(0);
if (compute() == 0) {
system("cls");
display();
cout << "黑方胜!" << endl;
break;
}
if (compute() == 2) {
system("cls");
display();
cout << "平局!" << endl;
break;
}
place(1);
if (compute() == 1) {
system("cls");
display();
cout << "白方胜!" << endl;
break;
}
if (compute() == 2) {
system("cls");
display();
cout << "平局!" << endl;
break;
}
}
cout << "再来一局?Y/N ";
o = getch();
if (o == 'Y' || o == 'y') goto game_start;
break;
}
cout << endl;
}
}
}
}
}