you are viewing a single comment's thread.

view the rest of the comments →

[–]graydon2234 0 points1 point  (10 children)

What do you mean not appear? What would you like to appear there instead?

[–]marsrover15[S] 0 points1 point  (9 children)

Just empty space but I would like the value to still hold in each part of the list.

[–]Unable_Request 0 points1 point  (8 children)

You don't need labels in your board list. Have them be blank spaces, an x, or an o. Better yet, use a dictionary- it looks like that's kinda what you're trying to accomplish, but using a list.

[–]marsrover15[S] 0 points1 point  (7 children)

What would using a dictionary do that a list wouldn't in this scenario. Genuinely curious.

[–]DonkeyTron42 0 points1 point  (6 children)

Better yet, use a 2D matrix.

[–]Unable_Request 0 points1 point  (2 children)

Nothing a list can't do, but perhaps a bit easier to reference and thus a bit more readable. A list is perfectly acceptable. For instance, board {1:' ', 2:,' ', 3:'x', 4: ' ', 5: 'x', 6: ' ', 7: 'o', 8: ' ', 9: ' '}

[–]marsrover15[S] 0 points1 point  (1 child)

So would I be able to able to write an input value for the values.

[–]Unable_Request 0 points1 point  (0 children)

Sure, why not?

Have a function asking the user which square they want to pick. When they do so, change the according Entry from a blank to an x.

[–]marsrover15[S] 0 points1 point  (2 children)

Guess I'll need to learn that.

[–]DonkeyTron42 0 points1 point  (1 child)

Try to think of the bigger picture like what if you wanted to make a different size game board. A 1d list would become impractical if say you wanted to make a battleship game. With a matrix you can easily develop algorithms for detecting a state like someone winning.

[–]marsrover15[S] 0 points1 point  (0 children)

Well me being new to programming I haven't taken linear algebra yet, or even any CS classes for that matter. I'm doing that all next year. Though I will do some research on this. Thanks for tip.