数字炸弹,还没开始写

· · 休闲·娱乐

#include <bits/stdc++.h> 
#include <windows.h>

using namespace std; 

void HideCursor () {
    HANDLE hOutput = GetStdHandle(STD_OUTPUT_HANDLE);
    CONSOLE_CURSOR_INFO cursorInfo;

    GetConsoleCursorInfo(hOutput, &cursorInfo);

    cursorInfo.bVisible = FALSE;

    SetConsoleCursorInfo(hOutput, &cursorInfo);
}


bool key_pressed (int vk) {
    return (GetAsyncKeyState (vk) & 1) != 0;
}

void gotoxy(int x, int y) {
    COORD coord;
    coord.X = x;
    coord.Y = y;
    SetConsoleCursorPosition(GetStdHandle(STD_OUTPUT_HANDLE), coord);
}

signed main (void) {
    HideCursor ();
    bool now_choose = false;
    while (! key_pressed ('Z')) {
        cout << "请选择模式(无尽模式或单轮)" << endl;
        if (now_choose)
            cout << "[ ] 单轮模式    [v] 无尽模式" << endl;
        else 
            cout << "[v] 单轮模式    [ ] 无尽模式" << endl;
        if (key_pressed (VK_RIGHT) || key_pressed (VK_LEFT)) {
            now_choose = !now_choose;
        }
        gotoxy (0, 0);
        // Sleep (50);
    }

    cout << "请按任意键继续...\n";


    return 0;
}