▍1. game2048
#include #include #include #include #include #include #include #include using namespace std; int table[16]={0},Score=0,Max_number=0; bool allprint=true; int&at(int* pn,int x,int y=-1,bool rev=false){ return rev?(~y?pn[x*4+y]:pn[x]):(~y?pn[y*4+x]:pn[x]); } bool canMove(int* pn,int direction){ for(int i=0,sum=0;i