非游戏 · 2 母亲节快乐!

· · 个人记录

#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;
}