#define _CRT_SECURE_NO_WARNINGS
#include<stdio.h>
#include<time.h> //使用当前时钟作为随机数种子 time()
#include<stdlib.h> //srand() rand()
#include<Windows.h> //system("command")//执行dos命令“command”
#include<conio.h>//getch();//从键盘读取字符并返回,但不显示在屏幕上
//#include<graphics.h>
typedef struct x_y
{ //用来存放一个坐标
int x;
int y;
}x_y;
static x_y get_xy();
int a[4][4];
int empty;//数组中空格的数目
char input;//输入控制方向的键
int score=0;
void init(); //初始化数组
void show(); //打印4X4方格及数组数据
void to_up(); //接收键盘输入,来控制数据移动方向
void to_down();
void to_left();
void to_right();
void add_num(); //随机添加一个数字到数组
void play();
void print_2048()
{
printf("******************** ************************ ******** ******** ************************\n");
printf("******************** ************************ ******** ******** ************************\n");
printf("******************** ************************ ******** ******** ************************\n");
printf(" ******* ****** ****** ******** ******** ****** ******\n");
printf(" ******* ****** ****** ******** ******** ****** ******\n");
printf(" ******* ****** ****** ******** ******** ****** ******\n");
printf(" ******* ****** ****** ******** ******** ****** ******\n");
printf(" ******* ****** ****** ******** ******** ****** ******\n");
printf("******************** ****** ****** ************************* ************************\n");
printf("******************** ****** ****** ************************* ************************\n");
printf("******************** ****** ****** ************************* ************************\n");
printf("******* ****** ****** ******** ****** ******\n");
printf("******* ****** ****** ******** ****** ******\n");
printf("******* ****** ****** ******** ****** ******\n");
printf("******* ****** ****** ******** ****** ******\n");
printf("******************** ************************ ******** ************************\n");
printf("******************** ************************ ******** ************************\n");
printf("******************** ************************ ******** ************************\n");
}
int main(void)
{
//system("mode con cols=63 lines=32");
system("color C9");
print_2048();
printf(" \n\n\n\n ++++++++++++++++++++++++++++\n");
printf(" Welcome to 2048 \n\n");
printf(" Control by:\n" );
printf(" w/s/a/d or W/S/A/D\n\n" );
printf(" press q or Q quit game!\n" );
printf(" ++++++++++++++++++++++++++++\n");
printf(" Any key to continue . . .\n" );
/*initgraph(600,600);