Hi,

This is an assignment. I am really new to C, so please have patience with me.

I need to create 12x12 matrix populated with random numbers(0 to 250) and 10% blank spaces. From the center of the matrix (this is odd because a 12x12 matrix is not symmetric), i need to create a movement pattern horizontally or vertically. The cell numbers hit must be greater that the starting number and of course the starting number cannot be blank.

So far I succeed to create a 2d array with random numbers. I am really under pressure because on Friday I need to hand-out the assignment.

This is my code and thanks in advance:

Code:const int a=12; const int b=12; int matrix[a][b]; int rnum; int t[a]; srand(time(0)); // Initialize random number generator. rnum = (rand() % 100) + 1; for(int r=0; r<a; r++)//row { for(int c=0; c<b; c++) matrix [r][c] = (rand()%250) + 1; } for(int r=0; r<a; r++)//row { for(int c=0; c<b; c++) //column { cout << matrix[r][c] << ' '; //display table } cout << endl; }

getchar();

return 0;