[Solved] Increase stack size c#

What you can do is: If Creation fails pass back a bool and try again from scratch. public void Generate() { Fill(); while(!Fleet()) { // I assume Fill clears your board again?! Fill(); } } public bool Fleet() { return Ship2(Utility.R(1,9),Utility.R(1,9),Utility.R(4)) && Ship3(Utility.R(1,9),Utility.R(1,9),Utility.R(4)) && Ship3(Utility.R(1,9),Utility.R(1,9),Utility.R(4)) && Ship4(Utility.R(1,9),Utility.R(1,9),Utility.R(4)) && Ship5(Utility.R(1,9),Utility.R(1,9),Utility.R(4)); } public bool Ship2(int x, int … Read more

[Solved] Getting Infinite Loop Issue. Process Terminated due to StackOverflowException?

In class2, you are calling Console.WriteLine(c1.inf1());. So class1.inf1 should return a string as you are trying to output it to the console. However, class1.inf1() recursively calls itself with no exit and does not return a string. So I think this may be what you are trying to accomplish: protected internal string inf1() { return “\n……inf1() … Read more

[Solved] Not sure why I am getting a StackOverflowError. Also have a yellow underline under Vector, and 1 other place in code

Calling setbounds from your reshape method would be causing stackoverflowerror. If you look at the source code of Component class the setBounds method calls the reshape method. So from your reshape method when you call super (Component) class setbounds method then from this Component setbounds method again your reshape overridden method is called which is … Read more