Here’s my function, the important line is where i call f() again.
def f(num,xyz,possible,temp):
y = num%9
x = num-y
print num
for xyz[num] in possible[num]:
if ispossibility(temp,xyz[num],x,y) == True:
temp[num] = xyz[num]
if num != 80:
f(num+1,xyz,possible,temp) # i call f() with num incremented
else:
print 'yes'
exit()
The output of the program is
0
1
2
3
4
5
6
7
8
3
2
3
3
The problem is that whenever the function f() is called, the variable num should always be incremented by 1. But from the output, f() is called with num as 3, when it was previously eight. And so i am wondering how that is possible (the output should be 9 btw, and not 3) when f() is always called w/ num incremented by 1. I’ve been looking at this function for some time now and i really don’t understand what is happening.
You call
f(num+1, ...)inside of a loop, so it is possible to callf()with the same value fornummultiple times.