the cursus i'm taking on python (free on internet).
said i know enough and that i should try creating some simple games like oxo.
the problem is that i don't know how the create a framework for such a game
any help is welcome.
p.s. my english may not be that wel :)
(i'm from belguim)
After you have the empty array set up you can write a function to print it nicely.
Also, you could just use a single dimension array and parse it accordingly.
I am just thinking about a basic text based tic-tac-toe, it could print the current state and then you could put in an (x,y) of where you wanna make your mark, if you were thinking of a gui driven kinda thing with a clickable interface, then thats a whole different game.
list = [["-","-","-"],["-","-","-"],["-","-","-"]]
for x in list:
o - -
- - x
- - -
o - -
- o x
- - -
i put it into a list to be able to edit the content
That's good there. My only suggestion would be to not use the identifier 'list' as it's a built-in python type.
>>> my_tup = (1,2,3,4,5)
[1, 2, 3, 4, 5]
Help on class list in module __builtin__:
| list() -> new list
| list(sequence) -> new list initialized from sequence's items
| Methods defined here:
#.... Snipped for brevity... you get the point