
February 10th, 2012, 03:09 PM
|
|
Registered User
|
|
Join Date: Feb 2012
Posts: 16
Time spent in forums: 3 h 25 m 10 sec
Reputation Power: 0
|
|
|
Tic Tac Toe Game help with error.
So I've tested out the code for one of my assignments. I had to basically fill in board.py. When I try to run it, its giving me the following error:
Quote:
Python 3.2.2 (v3.2.2:137e45f15c0b, Sep 3 2011, 17:28:59)
[GCC 4.2.1 (Apple Inc. build 5666) (dot 3)]
Type "help", "copyright", "credits" or "license" for more information.
>>> [evaluate TicTacToe.py]
1 | 2 | 3
-----------
4 | 5 | 6
-----------
7 | 8 | 9
It is Player X's turn.
Traceback (most recent call last):
File "/Applications/WingIDE.app/Contents/MacOS/src/debug/tserver/_sandbox.py", line 69, in <module>
File "/Applications/WingIDE.app/Contents/MacOS/src/debug/tserver/_sandbox.py", line 58, in main
File "/Users/Jiawei/GameController.py", line 107, in play_game
File "/Users/Jiawei/GameController.py", line 130, in _get_valid_player_move
File "/Users/Jiawei/RandomPlayer.py", line 29, in select_next_move
builtins.AttributeError: 'list' object has no attribute 'is_valid_move'
>>> |
How do I fix this? Is it because I am returning a copy of self._board when I am supposed to copy the whole instance of the Board class and return a Board object.
Assignment Zip file(as-175-3-skeleton.zip): https://sites.google.com/site/jishent/files
|