Computer Science Canada First shot at classes with Turing |
Author: | neufelni [ Wed Feb 14, 2007 8:24 am ] | ||
Post subject: | First shot at classes with Turing | ||
So I decided the other day to start making a card game with Turing. Shortly after starting I decided to give it a try using classes. Never used classes before in Turing, but here's what I've got so far. For now it just shuffles and deals.
Let me know how I can make improvements to this. |
Author: | ericfourfour [ Wed Feb 14, 2007 5:25 pm ] |
Post subject: | RE:First shot at classes with Turing |
Have you read cervantes' tutorials on object orientation? I think you are missing the point. If you noticed, you can take those methods out of the class and they will still run fine. Basically, the class is useless in this program. I would start with a card class. This will contain all of the attributes for a card and any actions the card may need to do. Then have a deck class. This will contain a list of cards and shuffle them. You could also have a dealer and player class. The dealer can pop a card off the top of the deck and give it to a player. The dealer can also take a card from a player and push it onto the bottom of the deck. |