#include #include #include #include #include #include #include #include using namespace std; int bouble1, bouble2, state = 0, trave = 0, dkdung = 0; int buttonA; int buttonB; int buttonC, bienCorrect; int score = 0, KtraThread = 0; void InScore(int Sc); void ChonKey(int &buttonA, int &buttonB, int &buttonC, int &bienCorrect, int &score); //int inBouble(int &bouble1,int &bouble2); void resizeConsole(int width, int height) { HWND console = GetConsoleWindow(); RECT r; GetWindowRect(console, &r); MoveWindow(console, r.left, r.top, width, height, TRUE); } void textcolor(int x) { HANDLE mau; mau = GetStdHandle(STD_OUTPUT_HANDLE); SetConsoleTextAttribute(mau, x); } void Nocursortype()//an dau nhay { CONSOLE_CURSOR_INFO Info; Info.bVisible = FALSE; Info.dwSize = 20; SetConsoleCursorInfo(GetStdHandle(STD_OUTPUT_HANDLE), &Info); } void gotoxy(int x, int y) { HANDLE hConsoleOutput; COORD Cursor_an_Pos = { x - 1, y - 1 }; hConsoleOutput = GetStdHandle(STD_OUTPUT_HANDLE); SetConsoleCursorPosition(hConsoleOutput, Cursor_an_Pos); } void XoaManHinh() { HANDLE hOut; COORD Position; hOut = GetStdHandle(STD_OUTPUT_HANDLE); Position.X = 0; Position.Y = 0; SetConsoleCursorPosition(hOut, Position); } void veKhung() { resizeConsole(800, 600); /*for (int i =2; i < 35; i++) { gotoxy(40,i); cout<<"|\n"; }*/ for (int i = 1; i<35; i++) { textcolor(34); cout << " \n"; } textcolor(12); } void InScore(int Sc) { gotoxy(25, 1); textcolor(39); cout << "Score:" << Sc; textcolor(12); gotoxy(28, 4); } int HamBouble() { srand(time(0)); bouble1 = rand() % (51); bouble2 = rand() % (51); trave = bouble1 + bouble2; //Sleep(50); gotoxy(10, 10); textcolor(129); cout << " " << bouble1 << " "; textcolor(34); cout << "\t\t"; textcolor(129); cout << " " << bouble2 << " "; return 0; } /*int inBouble(int &bouble1,int &bouble2) { gotoxy(10,10); textcolor(129); cout<<" "<