Code Comments
Programming Forum and web based access to our favorite programming groups.I have problem with my flood fill code. The code will bring me to infinite loop. Finally it says that the recursion limit is reached. Pushing up the limit doesnt work. Whats wrong with my code? ---------------code------- function [A,i,j]=recur(A,i,j,color); [M N]=size(A); if(i<2|i>=M|j<2|j>=N|A(i,j)<100|A(i,j)==50), return; else (A(i,j))>100, A(i,j)=color; recur(A,i+1,j,color); recur(A,i-1,j,color); recur(A,i,j+1,color); recur(A,i,j-1,color); end -------------end of code----
Post Follow-up to this messagePowered by vBulletin
Copyright 2000-2006 Jelsoft Enterprises Limited.