|
@@ -1,4 +1,3 @@
|
|
|
-#include <stdio.h>
|
|
|
|
|
#include <time.h>
|
|
#include <time.h>
|
|
|
#include <stdlib.h>
|
|
#include <stdlib.h>
|
|
|
#include <unistd.h>
|
|
#include <unistd.h>
|
|
@@ -38,30 +37,3 @@ int randomY(const clock_t initClock) {
|
|
|
void sleep_ms(const int ms) {
|
|
void sleep_ms(const int ms) {
|
|
|
usleep(ms * 1000);
|
|
usleep(ms * 1000);
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
-void setBoardBorders(char board[][brdInfo.x]) {
|
|
|
|
|
- for (int i = 0; i < brdInfo.y; i++) {
|
|
|
|
|
- for (int j = 0; j < brdInfo.x; j++) {
|
|
|
|
|
- if (i == 0 || i == brdInfo.y - 1)
|
|
|
|
|
- board[i][j] = '-';
|
|
|
|
|
- else if (j == 0 || j == brdInfo.x - 1)
|
|
|
|
|
- board[i][j] = '|';
|
|
|
|
|
- else
|
|
|
|
|
- board[i][j] = ' ';
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- board[0][0] = '+';
|
|
|
|
|
- board[brdInfo.y - 1][0] = '+';
|
|
|
|
|
- board[0][brdInfo.x - 1] = '+';
|
|
|
|
|
- board[brdInfo.y - 1][brdInfo.x - 1] = '+';
|
|
|
|
|
-}
|
|
|
|
|
-
|
|
|
|
|
-void printBoard(char board[][brdInfo.x]) {
|
|
|
|
|
- for (int i = 0; i < brdInfo.y; i++) {
|
|
|
|
|
- for (int j = 0; j < brdInfo.x; j++) {
|
|
|
|
|
- printf("%c", board[i][j]);
|
|
|
|
|
- }
|
|
|
|
|
- printf("\n");
|
|
|
|
|
- }
|
|
|
|
|
-}
|
|
|