|
@@ -72,12 +72,18 @@ def naive(start):
|
|
|
# iterate over all values in the domain list
|
|
|
while solution[index[0]][index[1]]:
|
|
|
i = solution[index[0]][index[1]].pop()
|
|
|
+ count += 1
|
|
|
+ # took too long
|
|
|
+ if (count >= 10000):
|
|
|
+ print("took too long")
|
|
|
+ return False
|
|
|
+
|
|
|
# check if this part of the domain(solution) is valid
|
|
|
if (valid(working, index[0], index[1], i)):
|
|
|
- count += 1
|
|
|
- if (count >= 10000):
|
|
|
- print("took too long")
|
|
|
- return False
|
|
|
+ #count += 1
|
|
|
+ #if (count >= 10000):
|
|
|
+ # print("took too long")
|
|
|
+ # return False
|
|
|
solution[index[0]][index[1]].append(i) # keep in the domain
|
|
|
working[index[0]][index[1]] = i
|
|
|
assumptions.append(index)
|