PYTHON PROJECT * LOOKING FOR ACTUAL CODE Outline of full project: http://www.cse.msu.edu/~cse231/...

PYTHON PROJECT * LOOKING FOR ACTUAL CODE

Outline of full project: http://www.cse.msu.edu/~cse231/Online/Projects/Project10/Project10.pdf

from here http://www.cse.msu.edu/~cse231/Online/Projects/Project10/ use "proj10.py" for code foundation and for card classes

Summary: This project we have to create the game Bakers Free Cell which is a form of solitaire which you can play here to pick up the rules http://www.247freecell.com/bakersGameFreecell.php. In bakers game cards stack by decreasing value in the tableau much like solitaire but in this unique version they stack by matching suit as well.

Help: We recently learned classes and I am so lost! We are given the classes to call but I do not even know where to begin. Im a very good visual learner and I believe if i could see the display and a couple lines of code i could pick off from the start and finish this project. All im looking for is help on the first two functions on how to set up the game and lastly how to display just the basic formmating of the game. Im looking for actual python code. I understand the logic of what to do I just have no clue what to do or where to begin. Thank You!

Instructions:

1. setup_game() -> (cells, foundations, tableaus) setup_game takes no parameters. It creates and initializes the cells, foundations, and tableaus, then returns them as a tuple, in that order. The cells and foundations will be a lists of 4 empty lists, the Tableau will be a list of 8 lists, which will contain all of the cards dealt into 8 vertical columns from left to right as described before.

2. display_game(cells, foundations, tableaus) -> None display_game takes four parameters, which should be the lists representing the cells, foundations, and tableaus. The cells and foundations should be displayed above the tableaus. A non-empty cell should be displayed as the card within it, whereas an empty cell should be displayed as [ ]. A non-empty foundation will be displayed as the top card in the pile (i.e. the last card moved to it), while an empty foundation will also be displayed as [ ]. The tableau is displayed below the cells and foundations, and each column of the tableau will be displayed downwards as shown in the sample below. An empty column will be displayed by whitespace. (Suggestions: (1) at first simply print each data structure, e.g. print(tableaus) in this function until you get the rest of the program working. Then come back and do the formatting last. (2) when you get to formatting, convert the card to a string using str(), e.g. print("{:4s}".format(str(tableau[2][0])) )

Expert's Answer

Need Urgent Academic Assistance?

Get Professional Help at Low Prices!

*
*
*


*

TOP
Order Notification

[variable_1] from [variable_2] has just ordered [variable_3] Assignment [amount] minutes ago.