Commit 9830480f authored by Jakub Čirip's avatar Jakub Čirip
Browse files

Update

parents e7f91215 0c9d8025
...@@ -21,7 +21,7 @@ void add_random_tile(struct game *game){ ...@@ -21,7 +21,7 @@ void add_random_tile(struct game *game){
bool is_game_won(const struct game game){ bool is_game_won(const struct game game){
{ {
char win; int win;
for(int i=0; i<4; i++){ for(int i=0; i<4; i++){
for(j=0; j<4; j++){ for(j=0; j<4; j++){
...@@ -44,9 +44,15 @@ bool is_game_won(const struct game game){ ...@@ -44,9 +44,15 @@ bool is_game_won(const struct game game){
bool update(struct game *game, int dy, int dx){ bool update(struct game *game, int dy, int dx){
<<<<<<< HEAD
char w[] = {'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K'}; char w[] = {'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K'};
int c[] = {2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 2048}; int c[] = {2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 2048};
int chang=0, a=0, int chang=0, a=0,
=======
char word[] = {'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K'};
int num[] = {2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 2048};
int chang=1, a=0,
>>>>>>> 0c9d802546caefbf1df08b221d960213e904a20c
if(dy==1 && dx==0) if(dy==1 && dx==0)
{ {
...@@ -107,7 +113,11 @@ if(dy==1 && dx==0) ...@@ -107,7 +113,11 @@ if(dy==1 && dx==0)
} }
}else if(dy==0 && dx==1) }else if(dy==0 && dx==1)
{ {
<<<<<<< HEAD
//V Pravo //V Pravo
=======
>>>>>>> 0c9d802546caefbf1df08b221d960213e904a20c
chang=0; chang=0;
for(int i=0; i<4; i++){ for(int i=0; i<4; i++){
for(int j=3; 0<j; j--) for(int j=3; 0<j; j--)
...@@ -247,7 +257,11 @@ l ...@@ -247,7 +257,11 @@ l
{ {
game->board[i][v]=game->board[i][v+1]; game->board[i][v]=game->board[i][v+1];
game->board[i][v+1]=' '; game->board[i][v+1]=' ';
<<<<<<< HEAD
chang++; chang++;
=======
chang;
>>>>>>> 0c9d802546caefbf1df08b221d960213e904a20c
} }
} }
} }
...@@ -349,5 +363,5 @@ int num[] = {2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 2048}; ...@@ -349,5 +363,5 @@ int num[] = {2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 2048};
} }
b++; b++;
} }
return 0; return 1;
} }
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment