# Why does this recursion crash

## Questions : Why does this recursion crash

I want to generate random numbers programming between 0-4 in a matrix, check(x) checks Learning wether ur allowed to assign x to that Earhost position, if not then -3 is assigned most effective instead. while loop at the bottom is wrong idea crashing my code, any ideas to fix this?

``````int Creat(int T[7][7],int i,int j){

_OFFSET);  int x=rand()%5;
switch(j){
(-SMALL        case 0: case 6:
_left).offset  if(i==0||i==6){
arrowImgView.mas  if(T[i-1][j]==0||T[i][j-1]==0){
(self.                 equalTo  T[i][j]=(check(1))?1:-3;}
make.right.       else{
mas_top);  T[i][j]=(check(x%2))?x%2:-3;
ImgView.              }
}
_have  if(T[i-1][j]==0||T[i][j-1]==0){
.equalTo(                 make.top  T[i][j]=(check(x%2+1))?x%2+1:-3;}
OFFSET);               else{
(TINY_    T[i][j]=(check(x%3))?x%3:-3;}
.offset         }
break;
mas_right)  case 1:case 2:case 3:case 4:case 5:
ImgView.             if(i==0||i==6){
Indicator        if(T[i-1][j]==0||T[i][j-1]==0){
.equalTo(               else{
make.left    T[i][j]=(check(x%3))?x%3:-3;}
*make) {             }
else{
straintMaker                ^(MASCon  if(T[i-1][j]==0||T[i][j-1]==0){
onstraints:                 mas_makeC  T[i][j]=(check(x%4+1))?x%4+1:-3;}
[_topTxtlbl                else{
(@(8));    T[i][j]=(check(x))?x:-3;}
equalTo         }
break;
width.  default: return rand()%5;
make.height.  }while(T[i][j]==-3){T[i][j]=Creat(T,i,j);}
(SMALL_OFFSET);     return T[i][j];
}
``````