i have to do a project where there are nine boxes filled with number 1-8, and 1 space is empty, the game needs to be scrambled, also all the moves need to be saved. the game can be paused anytime during thegame. the object is to move the numbers into the black spot till they are all in order.
the grid i have needs to contain variables so that can be moved by the players
this what i have and i know it is far off
def board(): board = [1,2,3,4,5,6,7,8,9] for x in range(0, 9): print "|" if(board[x]==9): print "_" else: print board[x] if(x==8): print "|" board()
when i run that it looks like this
and this is how i need it to look:
what am i doing wrong? also how do i use the random.shuffle() function so i can scramble the numbers?
help would be greatly appriciated...
also how would i save every move, also the random fuction isnt working so i can scramble the numbers.
i am probably doing everything wrong to make a game board, cause i need everything to to be interchanglable when the players wants to move and adjecent number to the blank spot, any help anyone???
thanks alot ahead of time
also i can't seem to import array or random
in addition my project is attached if anyone didnt understand what i needed to to do
Number of downloads: 168
This post has been edited by wokeup2sleep: 04 March 2008 - 08:43 AM