国产亚音游《Chickenrose》将于2024年2月30日开服
  • 板块灌水区
  • 楼主Ink_Rain
  • 当前回复11
  • 已保存回复11
  • 发布时间2023/5/21 10:33
  • 上次更新2023/10/23 15:09:44
查看原帖
国产亚音游《Chickenrose》将于2024年2月30日开服
672022
Ink_Rain楼主2023/5/21 10:33

没错误判定,有些许卡顿

#include <bits/stdc++.h>
#include<windows.h>
#include<stdio.h>
#include<iostream>
#include<bitset>
#define KEY_DOWN(VK_NONAME) ((GetAsyncKeyState(VK_NONAME) & 0x8000) ? 1:0)
using namespace std;
deque<string> maps;
deque<char> keys;



int main() {
	int n=0;
	int i=3;
	int min,max;
	min = 1;
	max = 4;
	int combo=0;
	int len=20,speed=10; //刷新间隔,下落间隔,长度可自调



	while (1) {

		if(i%3!=0) maps.push_front("     |   |   |   |   |        ");
		else {
			int a = rand() % (max - min + 1) + min;
			if(a == 1) {
				maps.push_front("     | ■|   |   |   |      ");
				keys.push_back('D');
			}
			if(a == 2) {
				maps.push_front("     |   | ■|   |   |    ");
				keys.push_back('F');
			}
			if(a == 3) {
				maps.push_front("     |   |   | ■|   |  ");
				keys.push_back('J');
			}
			if(a == 4) {
				maps.push_front("     |   |   |   | ■|");
				keys.push_back('K');
			}
		}
		i++;
		system("cls");
		if(i>len) {
			for(int a=0; a<maps.size(); a++) {
				cout<<maps[a]<<endl;
			}
			cout<<"     | □| □| □| □|"<<"            Combo: "<<combo<<endl;
			cout<<"     | D | F | J | K |"<<endl;
			cout<<"     -----------------"<<endl;
			if(maps.size()>=len)maps.pop_back();
			Sleep(speed);
			if(i%3==0) {

				while (KEY_DOWN(keys[n]) == false) {
					Sleep(0.1);
				}

				combo++;

				while (KEY_DOWN(keys[n]) == true) {
					Sleep(0.1);
				}
				n++;

			}
		}
	}
}

2023/5/21 10:33
加载中...