C++ help please, write a simple game
![]() ![]() ![]() ![]() ![]() |
C++ help please, write a simple game
|
|
Jun 5 2006, 01:42 PM
Show posts by this member only |This post's rating (0+, 0-) | Post
#1
|
|
Newbie ![]() Group: Junior Member Posts: 13 Ratings earned: 0+, 0- Ratings given: 0+, 0- Joined: May 2005 |
I want to write a game, it's like word guessing game. Suppose that secret word is "Pascal". Then the program would output "*****" at the beginning. the player guesses one letter in every move. Anybody can help me or give me advice or solution. Thanks
|
|
|
Jun 5 2006, 02:15 PM
Show posts by this member only |This post's rating (0+, 0-) | Post
#2
|
|
Look at all my stars!! ![]() ![]() ![]() ![]() ![]() ![]() ![]() Group: Senior Member Posts: 3,647 Ratings earned: 0+, 0- Ratings given: 0+, 0- Joined: Jan 2003 |
Google hangman.
|
|
|
Jun 5 2006, 08:25 PM
Show posts by this member only |This post's rating (0+, 0-) | Post
#3
|
|
Newbie ![]() Group: Junior Member Posts: 13 Ratings earned: 0+, 0- Ratings given: 0+, 0- Joined: May 2005 |
|
|
|
Jun 5 2006, 09:23 PM
Show posts by this member only |This post's rating (0+, 0-) | Post
#4
|
|
........ Codemasters Group: Elite Posts: 1,794 Ratings earned: 0+, 0- Ratings given: 0+, 0- Joined: Jan 2003 |
QUOTE(iceberg @ Jun 5 2006, 08:25 PM) google "hangman+C+source code" get me this http://www.planetsourcecode.com/vb/scripts...=10464&lngWId=3 Hangman is basically a word guessing game where game over when a man get hanged. |
|
|
Jun 6 2006, 01:02 AM
Show posts by this member only |This post's rating (0+, 0-) | Post
#5
|
|
PHP Web Developer ![]() ![]() ![]() ![]() ![]() Group: Senior Member Posts: 835 Ratings earned: 0+, 0- Ratings given: 0+, 0- Joined: Nov 2004 |
From uncle google:
http://minnie.tuhs.org/UnixTree/V7/usr/src.../hangman.c.html http://www.incubus.co.uk/prog/c/hangman.htm http://www.planetsourcecode.com/vb/scripts...=10464&lngWId=3 http://www.gidforums.com/t-9010.html http://www.enigmasse.zenig.com/hangman/hangman.html http://www.cs.wisc.edu/~cs110/Programs/00-...am0/hangman.cpp http://www.natidea.com/learning/cse_2341/k...angman.cpp.html http://www.cs.ust.hk/~wangj/comp151/lab01/hangman.cpp http://cs.smu.ca/~hspcweb/old_site/2003/st...rew/Hangman.cpp |
|
|
Jun 15 2006, 03:54 PM
Show posts by this member only |This post's rating (0+, 0-) | Post
#6
|
|
Getting Started ![]() ![]() Group: Junior Member Posts: 53 Ratings earned: 0+, 0- Ratings given: 0+, 0- Joined: Mar 2006 From: Ampang "The place promised in our early days" :p |
WTA: what is the diffrent between ms Visual C++ and borland C++, which is better?
(~_~; ) This post has been edited by SouthernAllStar: Jun 15 2006, 03:54 PM |
|
|
Jun 15 2006, 06:43 PM
Show posts by this member only |This post's rating (0+, 0-) | Post
#7
|
|
........ Codemasters Group: Elite Posts: 1,794 Ratings earned: 0+, 0- Ratings given: 0+, 0- Joined: Jan 2003 |
QUOTE(SouthernAllStar @ Jun 15 2006, 03:54 PM) Both are IDE with their own compiler. Borland uses VCL as interface components (Delphi UI lib too)for native app while Ms VC uses mainly MFC for native app. It is like apple and orange. both are fruits. |
|
|
Jun 19 2006, 06:14 PM
Show posts by this member only |This post's rating (0+, 0-) | Post
#8
|
|
Look at all my stars!! ![]() ![]() ![]() ![]() ![]() ![]() ![]() Group: Senior Member Posts: 3,647 Ratings earned: 0+, 0- Ratings given: 0+, 0- Joined: Jan 2003 |
Extra:
Borland C++ last version is 5.02 which is many years ago. Borland C++Builder 6 is Borland's 'last' C++ only tools (ok still can compile Delphi) for standard Windows app. Borland C++BuilderX mainly for embeded or cross-platform app. Borland Developer Studio is the latest one-stop gigantic development suite. |
|
|
Jun 19 2006, 06:27 PM
Show posts by this member only |This post's rating (0+, 0-) | Post
#9
|
|
Look at all my stars!! ![]() ![]() ![]() ![]() ![]() ![]() ![]() Group: Senior Member Posts: 2,255 Ratings earned: 0+, 0- Ratings given: 0+, 0- Joined: Jun 2006 |
QUOTE(iceberg @ Jun 5 2006, 01:42 PM) I want to write a game, it's like word guessing game. Suppose that secret word is "Pascal". Then the program would output "*****" at the beginning. the player guesses one letter in every move. Anybody can help me or give me advice or solution. Thanks I give you the basic Idea la OKint main () { char guess; char input[4] = {'p', 'i', 'g'}; for (int j = 1; j < 4; i++) cout<<"*"; cout<<endl; cout<<"Guess a letter:"; cin<<guess; for (int i =1; i < 4; i++) { //remember keep track of the correctly guessed letters if (guess == input[i]) cout<<"the word with the letter reveal is"; else cout<<"No such letter in word" } } Then you fix it yourself, this one every general idea how to do your game... not even functioning... hehe.. Need to loop the input for user to guess every letter. Put your limit loop to max of you characters in the word you pick. |
![]() ![]() ![]() ![]() |
| Lo-Fi Version | Time is now: 22nd March 2010 - 03:03 AM |