saisrivatsan / aima-python

Automatically exported from code.google.com/p/aima-python
0 stars 0 forks source link

games.py line 121 missing argument in call to legal_moves method #8

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. call random_player(game,state) in games.py
2.
3.

What is the expected output? What do you see instead?

Expected: A valid move returned

Unexpected Outcome: 
Traceback (most recent call last):
  File "<pyshell#28>", line 1, in <module>
    games.random_player(game,gamestate)
  File "/aima-python-read-only/games.py", line 121, in random_player
    return random.choice(game.legal_moves(state))
TypeError: legal_moves() takes exactly 2 arguments (1 given)

What version of the product are you using? On what operating system?

Py 2.5.2 /linux latest aima code from svn

Please provide any additional information below.

To fix change line 121 
from:
return random.choice(game.legal_moves())
to:
return random.choice(game.legal_moves(state))

Original issue reported on code.google.com by nei...@gmail.com on 30 Jun 2008 at 1:55

GoogleCodeExporter commented 8 years ago
This issue was closed by revision r52.

Original comment by wit...@gmail.com on 1 Sep 2011 at 10:11