Why does this recursion crash

Questions : Why does this recursion crash

103

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.              }
                    }
     ReadIndicator             else{
                    _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){
   Read                       _have  T[i][j]=(check(x%2+1))?x%2+1:-3;}
       .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];
}
Total Answers 1
26

Answers 1 : of Why does this recursion crash

Thank you @jonathan Leffler,@enhzflep use of case the while loop is free-standing.

Replacing it with if(T[i][j]==-3){...;} United fixes the problem.

Top rated topics

How to update database values of existing entites that have the "Init" accessor in Entity Framework Core

How to use Tri-Secret Key in Snowflake after Snowflake support enabled it for your account

How do you inject your appsettings.json configuration in a razor page C# code block?

Refreshing a materialized view with SQLAlchemy

Google script loop stops at first match

Python, Tkinter : insert request doesn't work

MySQL update query is executed but no change in data for some rows

When I try to input a string in C++, the program throws out a run time error

Spring boot data jdbc implement Many to Many relationship with same entity

How to round to nearest Thousand?

Separating typescript file (into 2 files) causes RequireJS Uncaught ReferenceError

How can I adding `transition` to my Popup

Share cookies accoss localhost ports

Nodered-OPC-UA-Siemens S7: why is my payload "0" when writing to my DB

How to open Gmail inbox from my React Native App with the search query already typed in?

How To Use Controller For Novay WordTemplate Laravel?

Org.hibernate.MappingException: Association references unmapped class: empresa.Empleados

Reading multiple DataFrames from a given input

Input "datetime-local" > js code that can update the current time automatically without having to click and select

Why is the hashCode instance method not named as getHashCode in Java?

Want to create react app offline becoz online creating time and internet consuming

ADO Pipeline - Restore Packages for DotNet 6

Embed plotly interactive figure in github-pages markdown

Remove x-labels from the last plot in ggplot

How to move GitLab CI/CD Runner Executor on another disk?

How to run the powershell script as administrator in AWS EC2 userdata

How to filter string using regex?

How to connect Database to chart added in Azure Devops widget

Self-references in object literals / initializers

Is it possible to disable the RStudio connections pane?

How to make display:flex items go to the next line, automatically?

Cannot window.blit if ships image is set to NONE but assigned later

Installing Tableau on Serverless Environment

How to make select statement in cshtml file?

How to upload a multiple images using vue.js filepond

Remove an array from a setlist if count above x

How to handle versioning of .lock.hcl across environments?

How to remove any commands that begins with "echo" from history

Show list of related objects in a template Django

Error Code: 1193. Unknown system variable "block_encryption_mode"

NodeJs Csv parser async operations

Using $1 in the @Query throws exception: Cannot encode parameter of type org.springframework.r2dbc.core.Parameter

How to hide unchecked box using jquery or php?

TwinCAT XAR showing file missing error on starting windows PC

Python: Watchdog RegexMatchingEventHandler matched undesired files

Newline (linebreak) after contenteditable div content

Spring boot JPQL with like operator issue with MySQL when column supports unicode characters

Angular 13.x - How to fix import * as i0 from '@angular/core' issue?

Flutter push notification's with firebase

Flink Job submission throws java.nio.file.NoSuchFileException while the file actually exists

Top