Skip to content

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

@GoogleCodeExporter

Description

@GoogleCodeExporter
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

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions