Hey guys,
I figure that I would start a new, more focused, topic relating to my problem. The original thread, "Neighbor search algorithm?", can be found here:
http://www.blitzbasic.com/Community/posts.php?topic=61909
Here is where I'm stuck:
The program tends to crash when I search to the north and to the west O_o
Here is the code:
Here are the calls that I made to test the code:
The program doesnt run until I comment out the following lines:
Anyone have any idea regarding what may be going wrong? I really dont want to give the impression that I am flooding the forum, but I have asked several other people about this problem and no one seems to be able to figure it out. :(
I figure that I would start a new, more focused, topic relating to my problem. The original thread, "Neighbor search algorithm?", can be found here:
http://www.blitzbasic.com/Community/posts.php?topic=61909
Here is where I'm stuck:
The program tends to crash when I search to the north and to the west O_o
Here is the code:
Method tesRegion(a_color$, x_coord%, y_coord%, region_num%) If Container[x_coord, y_coord].getBlockColor$() <> a_color Then Return Container[x_coord, y_coord].setRegion(region_num) If x_coord > 0 Then tesRegion(a_color$, x_coord - 1, y_coord, region_num) If x_coord < 13 Then tesRegion(a_color$, x_coord + 1, y_coord, region_num) If y_coord > 0 Then tesRegion(a_color$, x_coord, y_coord - 1, region_num) If y_coord < 11 Then tesRegion(a_color$, x_coord, y_coord + 1, region_num) Return End Method
Here are the calls that I made to test the code:
Global blockContainer:BContainer = New BContainer blockContainer.tesRegion(blockContainer.getContBlockColor(6,9), 6, 9, 1)
The program doesnt run until I comment out the following lines:
If x_coord > 0 Then tesRegion(a_color$, x_coord - 1, y_coord, region_num) If y_coord > 0 Then tesRegion(a_color$, x_coord, y_coord - 1, region_num)
Anyone have any idea regarding what may be going wrong? I really dont want to give the impression that I am flooding the forum, but I have asked several other people about this problem and no one seems to be able to figure it out. :(


