Ask your own question, for FREE!
Computer Science 17 Online
OpenStudy (dan815):

The cOde

OpenStudy (dan815):

OpenStudy (dan815):

@e.mccormick

OpenStudy (dan815):

you need those 2 files i made the program read that file too :) very big step haha

OpenStudy (e.mccormick):

Well, looks like you are really getting into the object orientated part.

OpenStudy (dan815):

why do you say that

OpenStudy (e.mccormick):

Declaring classes with constructors.

OpenStudy (dan815):

oh ya :)

OpenStudy (dan815):

i just want all the players to be able to check the card status and stuff

OpenStudy (dan815):

and then i wanna create a method under the players that gets the different cards they have and stuff

OpenStudy (dan815):

the hardest part!! was figuring out how to generate all those card objects

OpenStudy (dan815):

till i finally realized you can have a dictionary with object values

OpenStudy (dan815):

i was trying a whole bunch of stuff for that

OpenStudy (e.mccormick):

Hehe. 52 of them. I did something with them in C++... I should find all my old code sometime. Even from a different language it can be useful to see how it is done, then you write a version in the language you are working in.

OpenStudy (dan815):

oh hey right now

OpenStudy (dan815):

this is how the player checks the price of a card board_dict['Illinois Ave.'].price

OpenStudy (dan815):

how do i change this way

OpenStudy (dan815):

i want the user to be able to enter something simpler like just illinois.price

OpenStudy (dan815):

seems like a too much work to check a card though

OpenStudy (e.mccormick):

Well, it depends on the interface. Usually you will have the cards in some sort of dictionary, array, etc. Then you build a way to search for things. A common search trick is to convert the search and the lookup keys all to one case, upper or lower, and see if they match. But if you plan to do this all in a graphical interface, how a person searches may be as simple as clicking on an object.

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!