Permalink
Browse files

REFACTOR extract is_legal function

  • Loading branch information...
matatk committed Jul 15, 2014
1 parent 1eae605 commit 94daea6de4c96c7d085893e3f5ab701d8f11b779
Showing with 6 additions and 5 deletions.
  1. +6 −5 nac.py
View
11 nac.py
@@ -1,8 +1,9 @@
def test_legal_move():
last_move_was_legal = True
assert last_move_was_legal
assert is_legal(1)
def test_move_bounds_lower():
move = -1
last_move_was_legal = move > 0
assert last_move_was_legal is False
assert is_legal(-1) is False
def is_legal(move):
return move > 0

0 comments on commit 94daea6

Please sign in to comment.