[Tutor] List of lists help
A.T.Hofkamp
a.t.hofkamp at tue.nl
Thu Nov 20 09:28:58 CET 2008
btkuhn at email.unc.edu wrote:
> Hello,
>
> I am completely baffled by this action and would appreciate any help. My
> problem is occurring within a class which is within a larger program; if
> I need to post the entire program let me know and I will. It's only
> about 250 lines so far. Anyways, I am using a list of lists to store
> data in a GUI game called goMoku. It is kind of like a connect five
> game, pretty simple. When a user clicks a certain square, this line is
> called to store the "move":
>
> self.boardarray[row][col] = self.currentPlayer
The problem is most likely in how you construct your data structure.
If you want to post a follow-up with code, extract those lines and see if you
can construct the problem in <= 10 lines of code.
(any code with more than 15 lines is most likely too large to understand in
the time that people take to read a post here)
With respect to your problem, a similar problem has been discussed recently at
this list with dictionaries instead of lists, please read
http://mail.python.org/pipermail/tutor/2008-November/065283.html
If it doesn't answer your question, try to re-construct the problem in a small
example, and post that.
Sincerely,
Albert
More information about the Tutor
mailing list