Court and Player Number

This commit is contained in:
2026-04-24 15:44:16 -04:00
commit fdc6dd2004
5 changed files with 150 additions and 0 deletions

33
court.c Normal file
View File

@@ -0,0 +1,33 @@
#include "game.h"
#include <curses.h>
#include <signal.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
void DrawWalls(struct GameData data)
{
for (int i = LEFT_COL; i <= RIGHT_COL; i++) {
move(TOP_ROW, i);
addch('=');
move(BOT_ROW, i);
addch('-');
}
int col = LEFT_COL;
if (data.playerNumber > 0)
col = RIGHT_COL;
for (int i = TOP_ROW; i <= BOT_ROW; i++) {
move(i, col);
addch('|');
}
refresh();
}
void DrawHeader(struct GameData data)
{
move(TOP_ROW - 2, LEFT_COL);
addch('P');
addch('0' + (data.playerNumber + 1));
}