25 wprintf(L
": %d", points_1);
26 length = wcslen(
PLAYER_1) + wcslen(L
": ") + n;
27 for (i=0; i<12*2-length; i++)
34 wprintf(L
": %d", points_2);
44 for (i=0; i<
HEIGHT+2; i++){
49 for (j=0; j<
WIDTH+2; j++)
56 for (j=0; j<
WIDTH+2; j++){
57 if (j==0 || j==
WIDTH+1){
62 else if (mat_1[i-1][j-1].status >
EMPTY_BOX)
67 for (j=0; j<
WIDTH+2; j++){
68 if (j==0 || j==
WIDTH+1)
70 else if (mat_2[i-1][j-1].status >
EMPTY_BOX)
80void gameOver(
int points_1,
int points_2,
int mode){
84 if(points_1 != points_2){
101 else if(points_1 == points_2){
106 wprintf(L
"\r\n\r\n");
121 wprintf(L
"Piece: %d\r\n", i);
123 wprintf(L
"Rotation: %d\r\n", j);
127 wprintf(L
"%lc",
fSq);
129 wprintf(L
"%lc",
eSq);
void printCentered(wchar_t *text)
Print text centered horizontally based on string length.
int intLen(int value)
Calculate the length of a given number.
void heightSpacing(int filledHeight)
Apply a vertical spacing based on window heigth and what need to be printed.
const wchar_t fSq
Assign unicode character (black square) to this global variable.
const wchar_t eSq
Assign unicode character (white square) to this global variable.
void waitUser(void)
Wait until Enter key is pressed.
void clearCLI(void)
Call the system function to clear the cli.
void printPlayersName(int points_1, int points_2, int mode)
Print players' name.
void gameOver(int points_1, int points_2, int mode)
Print end screen result.
void printSpacing()
Print spaces between the two boards.
void printTetrominoes(TetrominoPtr parts)
Print all tetrominoes shapes.
void printBoard(BoardPtr mat_1, BoardPtr mat_2, int points_1, int points_2, int mode)
Print the game with object in the terminal.