what's wrong with this code ?

Code:// Random walk #include <stdio.h> #include <time.h> #include <stdlib.h> void set(); void print(); void generate(); int possible(int, int); char a[10][10]; int main() { set(); generate(); print(); return 0; } void set() { int i=0; int j = 0; for(i = 0; i < 10; i++) for(j = 0; j < 10; j++) a[i][j] = '.'; } void print() { int i,j; for(i = 0; i < 10; i++){ for(j = 0; j < 10; j++) printf("%c ", a[i][j]); printf("\n"); } } void generate() { int m,n; int next; int step = 'A'; m = n = 0; a[m][n] = step; while(1){ srand((unsigned) time(NULL)); next = rand() % 4; // printf("%d\n", next); step += 1; if(next == 0 && possible(m + 1, n)){ // move to right m += 1; a[m][n] = step; } else if(n == 1 && possible(m, n+1)){ // move down n += 1; a[m][n] = step; } else if(n == 2 && possible(m - 1, n)){ //move left m -= 1; a[m][n] = step; } else if(n == 3 && possible(m, n-1)){ // move up n -= 1; a[m][n] = step; }else break; } } int possible(int m, int n) { return m >= 0 && m <= 9 && n >=0 && n <= 9; }