Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 54078b4

Browse files
author
Greg Eakin
committed
Don't move the elements back to where the were.
1 parent 33fb529 commit 54078b4

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

‎ch18/ticTacToeTests.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,8 @@ def mutate_move(genes):
200200
toMove = genes[start:stop]
201201
genes[start:stop] = []
202202
index = random.choice(range(len(genes)))
203+
if index >= start
204+
index += 1
203205
genes[index:index] = toMove
204206
return True
205207

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /