Recursion not executing properly : Below is the snippet of my code
please note:

n=22

m=7

array = 0000110000111101000101

checker[] = false

     public static boolean ultra(int step)
    		 {
    			 System.out.println(step);
    			 if(step>n)
    			 {
    				 System.out.println("success1");
    
    				 win=true;
    
    				 return true;
    			 }
    			 else if (step+m>n-1)
    			 {
    				 System.out.println("success2");
    
    				 win=true;
    
    				 return true;
    			 }
    			 else if(step<0)
    			 {
    				 return false;
    			 }
    			 else
    			 {
    				try
    				{
    					 if(array[step+m]==0 && checker[step+m]==false)
    					 {
    						 System.out.println("jump");
    						 checker[step+m]=true;
    						 return ultra(step+m);
    					 }
    					 System.out.println("print "+step);
    
    					 if(array[step+1]==0 && checker[step+1]==false)
    					 {
    						 System.out.println("forward");
    
    						 checker[step+1]=true;
    						 return ultra(step+1);
    					 }
    					  if(array[step-1]==0 && checker[step-1]==false)
    					 {
    						 System.out.println("backward");
    
    						 checker[step+-1]=true;
    						 return ultra(step-1);
    					 }
    					 else
    					 {
    						 System.out.println("defeat");
    
    						 return false;
    					 }
    				}
    				catch(Exception e)
    				{
    					System.out.println(e.toString());
    				return false;
    				
    					
    				}
    				 
    				 
    				
    			 }
    			 
    		 }


When I call ultra(0), I get following output:



"0"
"jump"
"7"
"jump"
"14"
"print 14"
"defeat"


So basically, recursion is not going into the second if condition. It doesn't even print "print + step" for the first level. Hope it makes sense.