Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C++ > begging for a big help

Reply
Thread Tools

begging for a big help

 
 
shirin.no87@gmail.com
Guest
Posts: n/a
 
      12-10-2006
how to make solitaire game of win xp with c++?

the game should be in this way:

1to 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.
2n 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.

 
Reply With Quote
 
 
 
 
Gavin Deane
Guest
Posts: n/a
 
      12-10-2006

http://www.velocityreviews.com/forums/(E-Mail Removed) wrote:
> how to make solitaire game of win xp with c++?
>
> the game should be in this way:
>
> 1to 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.
> 2n 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-lit...t.html#faq-5.8

Gavin Deane

 
Reply With Quote
 
 
 
 
osmium
Guest
Posts: n/a
 
      12-10-2006
<(E-Mail Removed)> wrote:

<skip to end>

> how to make solitaire game of win xp with c++?
>
> the game should be in this way:
>
> 1to 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.
> 2n 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.



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
GIDS 2009 .Net:: Save Big, Win Big, Learn Big: Act Before Dec 29 2008 Shaguf ASP .Net 0 12-26-2008 09:29 AM
GIDS 2009 .Net:: Save Big, Win Big, Learn Big: Act Before Dec 29 2008 Shaguf ASP .Net Web Controls 0 12-26-2008 06:11 AM
GIDS 2009 Java:: Save Big, Win Big, Learn Big: Act Before Dec 29 2008 Shaguf Python 0 12-24-2008 07:35 AM
GIDS 2009 Java:: Save Big, Win Big, Learn Big: Act Before Dec 29 2008 Shaguf Ruby 0 12-24-2008 05:07 AM
Begging for a new feature! Alan P Firefox 2 04-03-2004 09:34 AM



Advertisments