废话少说,直接奉上代码:
main.c
代码如下:
#include”2048.h”
int main()
{
start_game();
return 0;
}
int main()
{
start_game();
return 0;
}
2048.h
代码如下:
#ifndef _2048_H_
#define _2048_H_
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
#include<termios.h>
//#include<unstd.h>
//#include<time/sys.h>
#define LINE 21
#define ROW 22
#define ARR_L 4
#define ARR_R 4
#define NUM_COLOR 32
#define BACK 49
#define BOLD 31
static int line_location=0;
static int row_location=0;
static int arr[4][4]={0};
static char tmp[5]=”
#define _2048_H_
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
#include<termios.h>
//#include<unstd.h>
//#include<time/sys.h>
#define LINE 21
#define ROW 22
#define ARR_L 4
#define ARR_R 4
#define NUM_COLOR 32
#define BACK 49
#define BOLD 31
static int line_location=0;
static int row_location=0;
static int arr[4][4]={0};
static char tmp[5]=”
