当前位置: 首页 > article >正文

[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() {
	SetConsoleTextA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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郑桐羽呀

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


http://www.kler.cn/a/328420.html

相关文章:

  • 身份证号码校验
  • 数据库-Derby
  • ASP.NET MVC宠物商城系统
  • 在ubuntu上安装ubuntu22.04并ros2 humble版本的docker容器记录
  • Vscode/Code-server无网环境安装通义灵码
  • 三维测量与建模笔记 - 点特征提取 - 4.3 Harris特征点
  • ARM base instruction -- ic
  • 滚雪球学MySQL[2.3讲]:MySQL数据过滤与排序详解:WHERE条件、ORDER BY排序与LIMIT分页查询
  • 物联网智能项目研究
  • 如何创建AWS云账号
  • 思维+贪心,CF 1210B - Marcin and Training Camp
  • SD-WebUI forge支持flux模型。算力互联forge镜像使用教程
  • 【鸿蒙学习】深入了解UIAbility组件
  • Java在用增强for循环遍历集合时删除元素,抛出java.util.ConcurrentModificationException异常
  • 【Verilog学习日常】—牛客网刷题—Verilog企业真题—VL69
  • 决策树中联合概率分布公式解释说明
  • 如何判断电器外壳是否带电
  • 十四、磁盘的管理
  • SpringBoot之Profile的两种使用方式
  • 二叉搜索树详解
  • 基于ARX结构的流密码算法Salsa20
  • mybatis-puls快速入门
  • Nginx的核心架构和设计原理
  • EnvoyFilter 是 Istio 中用于直接修改 Envoy 配置的一种资源类型
  • 帝都程序猿十二时辰
  • modelsim仿真 wave视图里 数据位宽和进制怎么显示