i need some help on how to print a box using 2d arrrays. i have to create a tetris game which a im stuck at this stage... so far i have tired i can only come out with this..
my coding done so far is as follows:
Code:
#include <stdio.h>
#define ROW 15
#define COLUMN 15
void disp_box (char b[ROW][COLUMN])
{
int r,c;
for(r=0; r<14;r++)
{
for(c=0; c<15;c++)
{
printf("_ ");
}
printf("\n");
}
}
int main(void)
{
char box[ROW][COLUMN];
char name[20] ="AAA" ;
int x,y;
printf("*************Tetris Game***********\n");
printf("Please Enter Player Name: ");
scanf("%s", &name);
printf("Player Name:%s\n", name);
for(x=0; x<15; x++)
{
for(y=0; y<15; y++)
{
box[x][y] = '_';
}
}
disp_box(box);
return 0;
}