#include<windows.h>
#include<stdlib.h>
#include<fstream>
#include<stdio.h>
#include<conio.h>
#include<time.h>
namespace std{
#define KEY 224
#define KEY_UP 72
#define KEY_DOWN 80
#define KEY_LEFT 75
#define KEY_RIGHT 77
#define UP ((KEY<<8)|KEY_UP)
#define DOWN ((KEY<<8)|KEY_DOWN)
#define LEFT ((KEY<<8)|KEY_LEFT)
#define RIGHT ((KEY<<8)|KEY_RIGHT)
int getin(){
int __t__return__ch__;
int __t__in__ch__first__=getch();
int __t__in__ch__second__=0;
if(__t__in__ch__first__==KEY){
__t__in__ch__second__=getch();
__t__return__ch__=(__t__in__ch__first__<<8)|__t__in__ch__second__;
}else{
__t__return__ch__=__t__in__ch__first__;
}
return __t__return__ch__;
}
void game_init(){
srand(time(NULL));
return;
}
void cls(){
system("cls");
return;
}
void pause(){
system("pause");
return;
}
void sleep(unsigned long __t__wait__time__){
_sleep(__t__wait__time__);
return;
}
void color(unsigned int __t__color__){
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),__t__color__);
return;
}
void setxy(unsigned int __t__xx__,unsigned int __t__yy__){
COORD __t__position__={__t__yy__*2,__t__xx__};
SetConsoleCursorPosition(GetStdHandle(STD_OUTPUT_HANDLE),__t__position__);
return;
}
void T(const char* __t__words__,unsigned int __t__set__words__color__=15){
color(__t__set__words__color__);
printf(__t__words__);
return;
}
void T(const char* __t__words__,unsigned int __t__words__xx__,unsigned int __t__words__yy__,unsigned int __t__set__words__color__=15){
color(__t__set__words__color__);
setxy(__t__words__xx__,__t__words__yy__);
printf(__t__words__);
}
int random(int __t__left__,int __t__right__){
int __t__lenght__=__t__right__-__t__left__+1;
int __t__rand__number__=rand()%__t__lenght__+__t__left__;
return __t__rand__number__;
}
void title(char __t__title__[]){
unsigned int __t__title__size__=sizeof(__t__title__);
char __t__set__title__[__t__title__size__+7];
__t__set__title__[0]='t';
__t__set__title__[1]='i';
__t__set__title__[2]='t';
__t__set__title__[3]='l';
__t__set__title__[4]='e';
__t__set__title__[5]=' ';
for(unsigned int __t__cont__=0;__t__cont__<__t__title__size__;__t__cont__++)
__t__set__title__[__t__cont__+6]=__t__title__[__t__cont__];
__t__set__title__[__t__title__size__+6]='\0';
system(__t__set__title__);
}
}