版本比较
2048
正文
增加 12 行删除 6 行
3 行未改动456789101189101112131415161718192020212223247 行未改动323334353637383940414299 行未改动142143144145143146147148149150244 行未改动全部展开3953963973983994004014024034043 行未改动#include <cstdio>#include <random>#include <ctime>
#define TRACK_LOST 400#define TRACK_COMPLETE 900 #define FULL_RECALL 1500#define PURE_MEMORY 2221#define TRACK_LOST 2221#define TRACK_COMPLETE 7200#define FULL_RECALL 12000#define PURE_MEMORY 17200
using namespace std;
mt19937 rng(time(0));
int map[8][8]={};
//操作:bool 并(int direction=1,2,3,4),随机生成1/2/4(40%/40%/20%)//操作:bool 并(int direction=1,2,3,4),随机生成2/4(80%/20%)//
void init();//Donevoid randGenerate();//Done7 行未改动int pts;
int main(){ cout<<"WELCOME TO 2048!\nUse WASD(Do not use the CapsLock) to control.\n"; system("pause"); system("cls"); init(); char op='\0'; while(1) {99 行未改动 if(cnt!=0) { int rnd=rng()%cnt+1; int d=rng()%10; d=1<<(d/8+1); d=1<<(d/9+1); int tmp=0; for(int i=1; i<=4; i++) { for(int j=1; j<=4; j++)244 行未改动全部展开 } } return;}
//4 4 4 4//0 0 8 8
```