mirror of
https://github.com/begilbert-sys/2048-in-C
synced 2024-12-25 21:58:33 +01:00
Update main.c
This commit is contained in:
parent
701b30c7b7
commit
59be269502
1 changed files with 2 additions and 2 deletions
4
main.c
4
main.c
|
@ -85,7 +85,7 @@ void draw_grid() {
|
||||||
void _addstr_centered(int tile_value) {
|
void _addstr_centered(int tile_value) {
|
||||||
/* draw the tile number so that it's centered */
|
/* draw the tile number so that it's centered */
|
||||||
int length = 1;
|
int length = 1;
|
||||||
if (tile_value != 0) {
|
if (tile_value != BLANK) {
|
||||||
// calculate length of integer
|
// calculate length of integer
|
||||||
length = log10(tile_value) + 1;
|
length = log10(tile_value) + 1;
|
||||||
}
|
}
|
||||||
|
@ -112,7 +112,7 @@ void display_board() {
|
||||||
for (int j = 0; j < 4; j++) {
|
for (int j = 0; j < 4; j++) {
|
||||||
int tile_value = board[i][j];
|
int tile_value = board[i][j];
|
||||||
int color_pair = COLOR_PAIR_DEFAULT;
|
int color_pair = COLOR_PAIR_DEFAULT;
|
||||||
if (tile_value != 0) {
|
if (tile_value != BLANK) {
|
||||||
color_pair = (int)log2(tile_value);
|
color_pair = (int)log2(tile_value);
|
||||||
}
|
}
|
||||||
attron(COLOR_PAIR(color_pair));
|
attron(COLOR_PAIR(color_pair));
|
||||||
|
|
Loading…
Reference in a new issue