473,399 Members | 3,919 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,399 software developers and data experts.

begging for a big help

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:on 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 '06 #1
2 1534

sh*********@gmail.com 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:on 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

Dec 10 '06 #2
<sh*********@gmail.comwrote:

<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:on 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.

Dec 10 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

21
by: Dave | last post by:
After following Microsofts admonition to reformat my system before doing a final compilation of my app I got many warnings/errors upon compiling an rtf file created in word. I used the Help...
6
by: wukexin | last post by:
Help me, good men. I find mang books that introduce bit "mang header files",they talk too bit,in fact it is my too fool, I don't learn it, I have do a test program, but I have no correct doing...
3
by: Colin J. Williams | last post by:
Python advertises some basic service: C:\Python24>python Python 2.4.1 (#65, Mar 30 2005, 09:13:57) on win32 Type "help", "copyright", "credits" or "license" for more information. >>> With...
7
by: Corepaul | last post by:
Missing Help Files When I enter "recordset" as the keyword and search the Visual Basic Help index, I get many topics of interest in the resulting list. But there isn't any information available...
6
by: Jax | last post by:
I have Visual Studio 2002 Standard Edition. It has been working fine up to a point and now i'm at that point. Due to the limitations of the edition i am not using any of my own .dll's and instead...
5
by: Steve | last post by:
I have written a help file (chm) for a DLL and referenced it using Help.ShowHelp My expectation is that a developer using my DLL would be able to access this help file during his development time...
3
by: The Eternal Squire | last post by:
Guido, It has been two years since PyCon 2005. I know I was a pest during the conference, and I am very sorry and regret my actions. At the time I had a 104 degree fever and pneumonia but...
2
by: Khushbu84 | last post by:
Hello, I am having a problem to display my text in the beginning of the Textarea. For some reason It just keeps some spaces and then starts displaying. I am trying to display answers of selected...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.