Poker

using data structures

Page 1 of 1

3 Replies - 2052 Views - Last Post: 29 November 2010 - 11:06 AM Rate Topic: -----

#1 17Naveed7  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 2
  • Joined: 10-November 10

Poker

Posted 28 November 2010 - 11:30 PM

hi i am a data structures student,
i have to make a poker game in C++. i know how to do it in OOP but i want to make this game using data structures. Does anyone have an idea what data structures can be used in a poker game?? please help ASAP

Is This A Good Question/Topic? 0
  • +

Replies To: Poker

#2 macosxnerd101  Icon User is online

  • Self-Trained Economist
  • member icon




Reputation: 10804
  • View blog
  • Posts: 40,277
  • Joined: 27-December 08

Re: Poker

Posted 28 November 2010 - 11:31 PM

You could use a Deque for the deck of cards, and a list or vector for the hand.
Was This Post Helpful? 0
  • +
  • -

#3 baavgai  Icon User is online

  • Dreaming Coder
  • member icon

Reputation: 5932
  • View blog
  • Posts: 12,854
  • Joined: 16-October 07

Re: Poker

Posted 29 November 2010 - 06:49 AM

Start with a card class. Then a deck class, which is good as a public stack implementation; you deal off of it. Hands are just vectors of card, similar to desk, but you don't need to shuffle them and probably need to figure out their value and maybe even sort them in some way.

This is a very common project and lends itself cleanly to OOP. Show your code, we'll go from there.
Was This Post Helpful? 0
  • +
  • -

#4 ZeroSixx  Icon User is offline

  • New D.I.C Head

Reputation: 3
  • View blog
  • Posts: 43
  • Joined: 04-March 10

Re: Poker

Posted 29 November 2010 - 11:06 AM

Data structures is just a focused, optimized version of OOP, not something completely different :). Write or draw out the program's allocation of memory before you start coding, ans try to use as few loops as possible for starters.

If you need specific help with optimization, run in to an error, or just want the community to review your work, we can, but we'll need to see your code. Have fun!
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1