2048游戏核心逻辑代码

 

 

main(){
  List a = [
    0,2,0,2,
    0,0,4,4,
    2,0,4,0,
    2,4,0,2
  ];

  List temp = right(a);  //change to others later,
  List result = [[],[],[],[]];
  for(int i=0; i<16; i++){
    result[i%4].add(temp[i]);
  }

  for(int i=0; i

  

转载于:https://www.cnblogs.com/pythonClub/p/10878164.html

你可能感兴趣的:(2048游戏核心逻辑代码)