So, here is the thing. I am dissecting some code to try and better understand how to finish my project (I'm a student. Made it to the final project without getting too lost!) and I am a little stuck. This part of the code randomly fills a 32x32 2D array with 0's and 1's. The 1's are what I need to focus on. Is there a way to show a blank space instead of a 0 so you just see the 1's?
Here is the array parts of the code! If you need to see more of it I can supply it! Didn't want to violate the "don't drown us in code" part right off the bat!
for(int i=0;i<steps;i++){
wait(1);
printArray();
checkNeighbor();
swapGrids();
//printf("\a");
}
scanf("%d");
return 0;
}
int fillArray(){ // fills the array with random cells. everything is a zero or a one.
int random=0;
srand(time(NULL));
for(int i=1;i<=size-1;i++){
for(int j=1;j<=size-1;j++){
random=rand()%2+0;
grid[i][j]=random;
}
}
return 0;
}
int printArray(){
system("cls");
//print all the stuff that's been pushed into our array
for(int i=0;i<=size;i++){
printf("\n");
for(int j=0;j<=size;j++){
printf("%d ",grid[i][j]);
}
}
return 0;
}