Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit fac9f8e

Browse files
committed
Moved an occasionally-failing doctest to random_tests and sped it up.
1 parent 65e7cf9 commit fac9f8e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

csp.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -329,8 +329,6 @@ class NQueensCSP(CSP):
329329
selection will also be O(1).
330330
>>> len(backtracking_search(NQueensCSP(8)))
331331
8
332-
>>> len(min_conflicts(NQueensCSP(8)))
333-
8
334332
"""
335333
def __init__(self, n):
336334
"""Initialize data structures for n Queens."""
@@ -451,4 +449,6 @@ def solve_zebra(algorithm=min_conflicts, **args):
451449
__doc__ += random_tests("""
452450
>>> min_conflicts(australia)
453451
{'WA': 'B', 'Q': 'B', 'T': 'G', 'V': 'B', 'SA': 'R', 'NT': 'G', 'NSW': 'G'}
452+
>>> min_conflicts(NQueensCSP(8), max_steps=10000)
453+
{0: 5, 1: 0, 2: 4, 3: 1, 4: 7, 5: 2, 6: 6, 7: 3}
454454
""")

0 commit comments

Comments
 (0)