[C++] 小游戏 征伐 SLG DNF 0.0.1 版本 zty出品

目录

[先赞后看 养成习惯](#先赞后看 养成习惯)

[War and Expedition SLG DNF 0.0.1 version](#War and Expedition SLG DNF 0.0.1 version)

讲人话就是

图标解释:

[绿色代表空地,可通过,对应数值 0](#绿色代表空地,可通过,对应数值 0)

[蓝色"~ "为水,不可通过,对应数值 1](#蓝色“~ ”为水,不可通过,对应数值 1)

[棕色"="为桥梁,可通过,对应数值 2](#棕色“=”为桥梁,可通过,对应数值 2)

[灰色三角形为高山,不可通过,对应数值 3](#灰色三角形为高山,不可通过,对应数值 3)

[白色双层同心圆为未定义的城池,可通过,对应数值 4](#白色双层同心圆为未定义的城池,可通过,对应数值 4)

[灰色边框为边界,不可通过,对应数值 5](#灰色边框为边界,不可通过,对应数值 5)

[蓝色圆形为己方城池,可通过,对应数值 6](#蓝色圆形为己方城池,可通过,对应数值 6)

[蓝色五角星为己方都城,可通过,对应数值 7](#蓝色五角星为己方都城,可通过,对应数值 7)

[紫色圆形为敌方城池,可通过,对应数值 8](#紫色圆形为敌方城池,可通过,对应数值 8)

[紫色五角星为敌方都城,可通过,对应数值 9](#紫色五角星为敌方都城,可通过,对应数值 9)

CODE:

[适配编译器: Dev C++ 6.7.5](#适配编译器: Dev C++ 6.7.5)

后记


大家好~~~~~~~~~~~~~~,好久不见,zty CSP初赛爆了,又来做游戏了,本次带来的是

先赞后看 养成习惯

War and Expedition SLG DNF 0.0.1 version

讲人话就是

War and Expedition = (游戏名,即征伐)

SLG = (即时战略类游戏)

DNF =(Did Not Finish)

0.0.1 = (内测版本号)

version = (版本)

本版本只包含地图打印及上色,

图标解释:

绿色代表空地,可通过, 对应数值 0
蓝色"~ "为水,不可通过,对应数值 1
棕色"="为桥梁,可通过,对应数值 2
灰色三角形为高山,不可通过,对应数值 3
白色双层同心圆为未定义的城池,可通过,对应数值 4
灰色边框为边界,不可通过,对应数值 5
蓝色圆形为己方城池,可通过,对应数值 6
蓝色五角星为己方都城,可通过,对应数值 7
紫色圆形为敌方城池,可通过,对应数值 8
紫色五角星为敌方都城,可通过,对应数值 9

CODE:

cpp 复制代码
#include<bits/stdc++.h>
#include<manyheader.h>
//#include<dpcq.h>
using namespace std;

void Yan(int a) {// 1蓝 2绿 3紫 4红 5黄 6深蓝
	if (a == 0) SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), FOREGROUND_INTENSITY | FOREGROUND_RED | FOREGROUND_GREEN | FOREGROUND_BLUE);
	if (a == 1) SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), FOREGROUND_INTENSITY | FOREGROUND_GREEN | FOREGROUND_BLUE);
	if (a == 2) SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), FOREGROUND_INTENSITY | FOREGROUND_GREEN);
	if (a == 3) SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), FOREGROUND_INTENSITY | FOREGROUND_RED | FOREGROUND_BLUE);
	if (a == 4) SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), FOREGROUND_INTENSITY | FOREGROUND_RED);
	if (a == 5) SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), FOREGROUND_INTENSITY | FOREGROUND_RED | FOREGROUND_GREEN);
	if (a == 6) SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), FOREGROUND_INTENSITY | FOREGROUND_BLUE);
	if (a == 7) SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), FOREGROUND_RED | FOREGROUND_GREEN);
	if (a == 8) SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), FOREGROUND_RED | FOREGROUND_GREEN | FOREGROUND_BLUE);
	if (a == 9) SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), FOREGROUND_INTENSITY);
	if (a == 10) SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), FOREGROUND_INTENSITY | FOREGROUND_GREEN | BACKGROUND_GREEN);
	if (a == 11) SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), FOREGROUND_RED | FOREGROUND_BLUE | BACKGROUND_GREEN);
	if (a == 12) SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), FOREGROUND_INTENSITY | FOREGROUND_RED | FOREGROUND_GREEN | BACKGROUND_GREEN);
	if (a == 13) SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), FOREGROUND_INTENSITY | FOREGROUND_GREEN | FOREGROUND_BLUE | BACKGROUND_INTENSITY | BACKGROUND_BLUE);
}
void Bai() {
	SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), FOREGROUND_INTENSITY | FOREGROUND_RED | FOREGROUND_GREEN | FOREGROUND_BLUE);
}

int tu[43][43] = { //1河流 2桥梁 3高山 4未定城 5地图边界 6我城 7我都 8敌城 9敌都
	{5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5},
	{5, 7, 0, 0, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5},
	{5, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5},
	{5, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5},
	{5, 6, 0, 0, 6, 0, 0, 0, 3, 0, 0, 0, 3, 3, 0, 0, 0, 0, 0, 0,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 0, 0, 0, 3, 0, 0, 0, 1, 1, 0, 0, 0, 0, 3, 3, 0, 0, 0, 0, 0, 0, 5},
	{5, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 2, 2, 0, 0, 0, 3, 3, 3, 0, 0, 8, 0, 0, 8, 5},
	{5, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2, 0, 0, 4, 3, 3, 0, 0, 0, 0, 0, 0, 0, 5},
	{5, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 3, 3, 0, 0, 0, 0, 0, 0, 0, 5},
	{5, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 3, 3, 3, 0, 0, 0, 8, 0, 0, 9, 5},
	{5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5},
};
int main() {
	system("mode con cols=84 lines=52");
	for (int i = 0; i < 42; i++) { //1河流 2桥梁 3高山 4未定城 5地图边界 6我城 7我都 8敌城 9敌都
		for (int j = 0; j < 42; j++) {
			switch (tu[i][j]) {
				case 1:
					Yan(13);
					cout << "~ ";
					break;
				case 2:
					Yan(7);
					cout << "〓";
					break;
				case 3:
					Yan(9);
					cout << "▲";
					break;
				case 4:
					Yan(0);
					cout << "◎";
					break;
				case 5:
					Yan(8);
					cout << "■";
					break;
				case 6:
					Yan(1);
					cout << "●";
					break;
				case 7:
					Yan(1);
					cout << "★";
					break;
				case 8:
					Yan(3);
					cout << "○";
					break;
				case 9:
					Yan(3);
					cout << "☆";
					break;
				case 0:
					Yan(10);
					cout << "十";
					break;
				default:
					break;
			}

		}
	}
	system("pause");
	return 0;
}

适配编译器: Dev C++ 6.7.5

后记

作者:zty郑桐羽呀

联系方式:(不挂了,有事私信)

相关推荐
百事老饼干6 分钟前
Java[面试题]-真实面试
java·开发语言·面试
customer0814 分钟前
【开源免费】基于SpringBoot+Vue.JS医院管理系统(JAVA毕业设计)
java·vue.js·spring boot·后端·spring cloud·开源·intellij-idea
可均可可28 分钟前
C++之OpenCV入门到提高004:Mat 对象的使用
c++·opencv·mat·imread·imwrite
幸运超级加倍~43 分钟前
软件设计师-上午题-16 算法(4-5分)
笔记·算法
杨荧44 分钟前
【JAVA毕业设计】基于Vue和SpringBoot的服装商城系统学科竞赛管理系统
java·开发语言·vue.js·spring boot·spring cloud·java-ee·kafka
白子寰1 小时前
【C++打怪之路Lv14】- “多态“篇
开发语言·c++
yannan201903131 小时前
【算法】(Python)动态规划
python·算法·动态规划
埃菲尔铁塔_CV算法1 小时前
人工智能图像算法:开启视觉新时代的钥匙
人工智能·算法
EasyCVR1 小时前
EHOME视频平台EasyCVR视频融合平台使用OBS进行RTMP推流,WebRTC播放出现抖动、卡顿如何解决?
人工智能·算法·ffmpeg·音视频·webrtc·监控视频接入