跳到正文

个人记录

非游戏 · 2 母亲节快乐!

xutongwei约 5 分钟
原文
文章信息与版本

文章信息

发布
2020年5月10日
收录
2025年12月12日
更新
2026年11月13日
篇幅
约 5 分钟

版本

  1. v1当前
C++
#include <iostream>
#include <windows.h>
#include <conio.h>
using namespace std;

void color(int a){
    SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),a);
}
void HideCursor(){
    CONSOLE_CURSOR_INFO cursor_info = {1, 0}; 
    SetConsoleCursorInfo(GetStdHandle(STD_OUTPUT_HANDLE), &cursor_info);
}
void block(int x,int y){
    HANDLE   hCon;
    hCon = GetStdHandle(STD_OUTPUT_HANDLE);  
    COORD   setps;
    setps.X = x;
    setps.Y = y;
    SetConsoleCursorPosition(hCon,setps);  
}

string a[1010];

int zzz1[10][5] = {{0}, {0, 9, 22, 12}, {0, 6, 14, 12}, {0, 6, 14, 12}, {0, 7, 14, 14}, {0, 7, 14, 14}, {0, 6, 10, 14}, {0, 6, 14, 14}, {0, 7, 14, 14}};
string zzz[10][100] = {{"0"}, {
"    ●●●  ●●●    ",
"  ●      ●      ●  ",
"●                  ●",
"●                  ●",
"  ●              ●  ",
"    ●          ●    ",
"      ●      ●      ",
"        ●  ●        ",
"          ●          "
},{
"  ●●  ●●  ",
"●    ●    ●",
"●          ●",
"  ●      ●  ",
"    ●  ●    ",
"      ●      "
},{
"  ●●  ●●  ",
"●●●●●●●",
"●●●●●●●",
"  ●●●●●  ",
"    ●●●    ",
"      ●      "
},{
"  ┏━━━┓  ",
"  ┃  ●  ┃  ",
"━╋━━━╋━",
"  ┃  ●  ┃  ",
"  ┗━━━╋━",
"          ┃  ",
"        ╰┛  "
},{
"      ●      ",
"━━━━━━━",
"    ╲  ╱    ",
"━━━━━━━",
"  ━━╋━━  ",
"    ╱┃╲    ",
"  ╱╰┛  ╲  "
},{
"━╋━╋━",
"          ",
"  ━┳┓  ",
"    ┃┛  ",
"    ┃    ",
"    ┃    "
},{
"  ┃    ┃    ",
"  ┃  ━╋┓  ",
"╱┃╲━╋┛━",
"  ┃    ┃    ",
"  ┃  ╱  ╲  ",
"  ┃╱      ╲"
},{
"      ╱      ",
"    ╱        ",
"  ┃  ┃      ",
"  ┗━╋━━  ",
"      ┃      ",
"    ╱┃╲    ",
"  ╱╰┛  ╲  ",
}};

void output(int x, int y, int z){
	/*
	if(z == 1) {
		freopen("1.out", "r", stdin);
	}else if(z == 2){
		freopen("2.out", "r", stdin);
	}else if(z == 3){
		freopen("3.out", "r", stdin);
	}else if(z == 4){
		freopen("4.out", "r", stdin);
	}else if(z == 5){
		freopen("5.out", "r", stdin);
	}else if(z == 6){
		freopen("6.out", "r", stdin);
	}*/
	color(zzz1[z][3]);
	for(int i = 0; i < zzz1[z][1]; i++){
		block(y, x + i);
		cout << zzz[z][i];
	}
}

int main( ){
	system("mode con cols=84 lines=28");
	HideCursor();
	output(2, 2, 1);
	output(19, 6, 2);
	output(12, 6, 3);
	output(2, 26, 4);
	output(2, 46, 5);
	output(10, 37, 6);
	output(2, 60, 1);
	output(19, 64, 2);
	output(12, 64, 3);
	output(16, 26, 7);
	output(15, 46, 8);
	getch();
	return 0;
}
原文
存档评论2 条抓取于