|
@@ -1,14 +1,18 @@
|
|
#include <stdio.h>
|
|
#include <stdio.h>
|
|
|
|
|
|
#define GRID_SIZE 9
|
|
#define GRID_SIZE 9
|
|
|
|
+#define GRID_MIDDLE GRID_SIZE/2
|
|
|
|
|
|
void initGrid(char grid[][GRID_SIZE]);
|
|
void initGrid(char grid[][GRID_SIZE]);
|
|
void printGrid(char grid[][GRID_SIZE]);
|
|
void printGrid(char grid[][GRID_SIZE]);
|
|
|
|
+void makeTree(char grid[][GRID_SIZE]);
|
|
|
|
|
|
int main(void) {
|
|
int main(void) {
|
|
char grid[GRID_SIZE][GRID_SIZE];
|
|
char grid[GRID_SIZE][GRID_SIZE];
|
|
|
|
+ char symbol = '*';
|
|
|
|
|
|
initGrid(grid);
|
|
initGrid(grid);
|
|
|
|
+ makeTree(grid);
|
|
printGrid(grid);
|
|
printGrid(grid);
|
|
|
|
|
|
return 0;
|
|
return 0;
|
|
@@ -28,3 +32,16 @@ void printGrid(char grid[][GRID_SIZE]) {
|
|
printf("\n");
|
|
printf("\n");
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+void makeTree(char grid[][GRID_SIZE]) {
|
|
|
|
+
|
|
|
|
+ for (int x = 0; x < GRID_SIZE; x++ ) {
|
|
|
|
+ for (int y = 0; y < GRID_SIZE; y++) {
|
|
|
|
+ grid[x][y] = ' ';
|
|
|
|
+ }
|
|
|
|
+ for (int y = 0; y < x/2; y++) {
|
|
|
|
+ grid[y][x] = '^';
|
|
|
|
+ grid[x][y] = '*';
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+}
|