begging for a big help

Discussion in 'C++' started by shirin.no87@gmail.com, Dec 10, 2006.

  1. Guest

    how to make solitaire game of win xp with c++?

    the game should be in this way:

    1:deal:to begin the game 28 cards are dealt into seven piles the
    leftmost pile has one card the next tow cards and so forth up
    tp seven
    cards in the rightmost pile only the upermost card of each of
    the
    seven piles is turnd face up.
    2:eek:n the topmost face-up card of each pile you may build in
    descending
    sequences red on black or black on red
    3:all face-up cards on a pile are movde as a unit and may be placed
    on
    another pile according to the bottommost face-up card.
    4:if the one pile remove completely a face-up king may be move from
    a
    pile (together with all cards above it)or the top of thewaste
    pile in
    to vacated space.
    5:cards are added to output piles in sequence.
    6:from the rest of the deck called the stock cards are turned up
    one
    by one and placed faced-up on the waste pile.you may always
    play cards
    off the top of the waste pile but only one at a time.
    , Dec 10, 2006
    #1
    1. Advertising

  2. Gavin Deane Guest

    wrote:
    > how to make solitaire game of win xp with c++?
    >
    > the game should be in this way:
    >
    > 1:deal:to begin the game 28 cards are dealt into seven piles the
    > leftmost pile has one card the next tow cards and so forth up
    > tp seven
    > cards in the rightmost pile only the upermost card of each of
    > the
    > seven piles is turnd face up.
    > 2:eek:n the topmost face-up card of each pile you may build in
    > descending
    > sequences red on black or black on red
    > 3:all face-up cards on a pile are movde as a unit and may be placed
    > on
    > another pile according to the bottommost face-up card.
    > 4:if the one pile remove completely a face-up king may be move from
    > a
    > pile (together with all cards above it)or the top of thewaste
    > pile in
    > to vacated space.
    > 5:cards are added to output piles in sequence.
    > 6:from the rest of the deck called the stock cards are turned up
    > one
    > by one and placed faced-up on the waste pile.you may always
    > play cards
    > off the top of the waste pile but only one at a time.


    Start with

    int main()
    {
    // Your solitaire code goes here
    }

    Have you read the FAQ? This one explains how to get help with code you
    are having trouble with.
    http://www.parashift.com/c -faq-lite/how-to-post.html#faq-5.8

    Gavin Deane
    Gavin Deane, Dec 10, 2006
    #2
    1. Advertising

  3. osmium Guest

    <> wrote:

    <skip to end>

    > how to make solitaire game of win xp with c++?
    >
    > the game should be in this way:
    >
    > 1:deal:to begin the game 28 cards are dealt into seven piles the
    > leftmost pile has one card the next tow cards and so forth up
    > tp seven
    > cards in the rightmost pile only the upermost card of each of
    > the
    > seven piles is turnd face up.
    > 2:eek:n the topmost face-up card of each pile you may build in
    > descending
    > sequences red on black or black on red
    > 3:all face-up cards on a pile are movde as a unit and may be placed
    > on
    > another pile according to the bottommost face-up card.
    > 4:if the one pile remove completely a face-up king may be move from
    > a
    > pile (together with all cards above it)or the top of thewaste
    > pile in
    > to vacated space.
    > 5:cards are added to output piles in sequence.
    > 6:from the rest of the deck called the stock cards are turned up
    > one
    > by one and placed faced-up on the waste pile.you may always
    > play cards
    > off the top of the waste pile but only one at a time.


    I am going to assume this is a variant of the game known as Klondike, I
    don't feel like searching through the rules to see of that is so.

    This is not a trivial thing you can crank out in an hour or two. If you
    have a white board, use it. Expect to make mistakes, perhaps meet dead
    ends and have to go back and redo earlier work. I presume you are expected
    to use the STL, especially vector and list to a considerable extent. Start
    by getting a way to represent a card, my first guess would be a struct.
    Note that the game is based largely on "red/black" distinctions, rather than
    the suit. Write a class (or two) to create a deck and shuffle the
    cards.Write a class that will create a tableau, q.v. Note that there will be
    three kinds of card, face down, face up, and topmost (the one visible) card.
    There will also be an empty pile. Perhaps you will want a "pile" class.
    The class should be able to answer questions such as "what is the displayed
    card"? Remember there may not *be* a card. So perhaps you invent the notion
    of a "null card" and make that a valid card identifier. Think in terms of
    seven to a dozen classes and one or two structures, that should be in the
    ball park.

    If you can't figure out to use some STL thing, write a separate little
    throwaway test program to see how to use it. The STL is written for a
    professional programmer and great generality, you will most likely find this
    a hindrance rather than a help.

    Compile often, remember that just because you compile it does not
    necessarily follow that you can run the program and get any meaningful
    results. Don't spend lot of time typing making a "cute" user interface,
    cuteness tends to attract a beginner, it defers the time when you must dig
    in and do the hard part. Don't sit back and expect much help, I am quite
    sure that no one will send you a working program. So start making notes
    and write some code.
    osmium, Dec 10, 2006
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Micah
    Replies:
    11
    Views:
    476
    DogWalker
    Apr 27, 2006
  2. Shaguf
    Replies:
    0
    Views:
    349
    Shaguf
    Dec 24, 2008
  3. Shaguf
    Replies:
    0
    Views:
    447
    Shaguf
    Dec 26, 2008
  4. Shaguf
    Replies:
    0
    Views:
    235
    Shaguf
    Dec 26, 2008
  5. Shaguf
    Replies:
    0
    Views:
    214
    Shaguf
    Dec 24, 2008
Loading...

Share This Page