Janzert / AEI

The Arimaa Engine Interface provides a standard method to communicate and control an Arimaa bot.
http://arimaa.janzert.com/aei/
Other
22 stars 5 forks source link

Added support for losing a game due to illegal moves. #5

Closed w-hat closed 6 years ago

w-hat commented 6 years ago

I could remove the old commit/revert if you'd like.

Janzert commented 6 years ago

I'm slowly working my way through it, with a few distractions along the way. ;)

One thing I did notice as I arrive at the game.py changes is that the changes have broken game.py tests:

$ python -m pyrimaa.test_runner
test_contruction (pyrimaa.tests.test_game.GameTest) ... ok
test_mintimeleft_handling (pyrimaa.tests.test_game.GameTest) ... ok
test_play (pyrimaa.tests.test_game.GameTest) ... Illegal move played: Tried to take more than 4 steps
FAIL
test_timecontrol_handling (pyrimaa.tests.test_game.GameTest) ... ok
test_max_reserve (pyrimaa.tests.test_util.TestTimeControl) ... ok
test_max_turntime (pyrimaa.tests.test_util.TestTimeControl) ... ok
test_movetime (pyrimaa.tests.test_util.TestTimeControl) ... ok
test_percentfill (pyrimaa.tests.test_util.TestTimeControl) ... ok
test_reservetime (pyrimaa.tests.test_util.TestTimeControl) ... ok
test_str (pyrimaa.tests.test_util.TestTimeControl) ... ok
test_time_limit (pyrimaa.tests.test_util.TestTimeControl) ... ok
test_turn_limit (pyrimaa.tests.test_util.TestTimeControl) ... ok
test_controller_protocol0 (pyrimaa.tests.test_aei.EngineControllerTest) ... ok
test_controller_protocol1 (pyrimaa.tests.test_aei.EngineControllerTest) ... ok
test_board (pyrimaa.tests.test_analyze.AnalyzeTest) ... ok
test_movelist (pyrimaa.tests.test_analyze.AnalyzeTest) ... ok
test_get_rnd_step_move (pyrimaa.tests.test_board.BoardTest) ... ok

======================================================================
FAIL: test_play (pyrimaa.tests.test_game.GameTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "pyrimaa/tests/test_game.py", line 421, in test_play
    self.assertRaises(IllegalMove, game.play)
AssertionError: IllegalMove not raised

----------------------------------------------------------------------
Ran 17 tests in 0.648s

FAILED (failures=1)
w-hat commented 6 years ago

Yikes! I should've run the tests before submitting a pull request. Thanks for looking at it!

Janzert commented 6 years ago

Now that I start actually looking at what the game.py changes are, I see that the primary purpose is to break that test. :)

If you have a chance to rework the test to check for an 'i' result instead of raising that would be great. I think I'm out of time to work on it more tonight. I should be able to pick it back up tomorrow.

Janzert commented 6 years ago

I think this is ready to go now. It'd be great if you don't mind reviewing and making sure it looks good.

Janzert commented 6 years ago

I've gone ahead and merged it in, if you do find any problems feel free to open a new issue.