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

目录

先赞后看 养成习惯

War and Expedition SLG DNF 0.0.1  version

讲人话就是

图标解释:

绿色代表空地,可通过,对应数值 0

蓝色“~ ”为水,不可通过,对应数值 1

棕色“=”为桥梁,可通过,对应数值 2

灰色三角形为高山,不可通过,对应数值 3

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

灰色边框为边界,不可通过,对应数值 5

蓝色圆形为己方城池,可通过,对应数值 6

蓝色五角星为己方都城,可通过,对应数值 7

紫色圆形为敌方城池,可通过,对应数值 8

紫色五角星为敌方都城,可通过,对应数值 9

CODE:

适配编译器: 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:

#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_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, 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郑桐羽呀

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

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值