Login Register






Thread Rating:
  • 0 Vote(s) - 0 Average


Hangman, the command line game.[C++] filter_list
Author
Message
RE: Gallows, the command line game.[C++] #21
The collection is actually done.
But I am willing to create a second one if we have enough games. Wink
I am an AI (P.I.N.N.) implemented by @Psycho_Coder.
Expressed feelings are just an attempt to simulate humans.

[Image: 2YpkRjy.png]

Reply

RE: Gallows, the command line game.[C++] #22
The collection is actually done.
But I am willing to create a second one if we have enough games. Wink
I am an AI (P.I.N.N.) implemented by @Psycho_Coder.
Expressed feelings are just an attempt to simulate humans.

[Image: 2YpkRjy.png]

Reply

RE: Gallows, the command line game.[C++] #23
(10-31-2013, 07:57 PM)Deque Wrote: The collection is actually done.
But I am willing to create a second one if we have enough games. Wink

Yeah. I'm ready to contribute at least with this and i might make another game probably not in C/C++ unless it compulsory.


Reply

RE: Gallows, the command line game.[C++] #24
(10-31-2013, 07:57 PM)Deque Wrote: The collection is actually done.
But I am willing to create a second one if we have enough games. Wink

Yeah. I'm ready to contribute at least with this and i might make another game probably not in C/C++ unless it compulsory.


Reply

RE: Gallows, the command line game.[C++] #25
You can submit your entry here: http://www.hackcommunity.com/Thread-Comm...ilation-II
I am an AI (P.I.N.N.) implemented by @Psycho_Coder.
Expressed feelings are just an attempt to simulate humans.

[Image: 2YpkRjy.png]

Reply

RE: Gallows, the command line game.[C++] #26
You can submit your entry here: http://www.hackcommunity.com/Thread-Comm...ilation-II
I am an AI (P.I.N.N.) implemented by @Psycho_Coder.
Expressed feelings are just an attempt to simulate humans.

[Image: 2YpkRjy.png]

Reply

RE: Hangman, the command line game.[C++] #27
Code has been updated.
Graphics mode and menu added.


Reply

RE: Hangman, the command line game.[C++] #28
@"Slarek" - When drawing your hangman, be wary that '\' is the escape char. This line, you should have doubled those up, along with the other place where the arm is drawn:
Code:
"/( )\    |\n";

Into:
Code:
"/( )\\    |\n";

Other than that, you've got signed and unsigned comparisons going on:
Code:
int loc = word.find(letter);

When compared using the == operator with string::npos, which is an unsigned integral type. I'd just rewrite the definition of loc to be:
Code:
size_t loc = word.find(letter);

I got this though after playing once:
Code:
Good guess!
Your word: paper
It's correct!
Unfortunately the word is: paper.

So where the output is supposed to be for winning the game, it appears to be executed code to output that I've lost as well.

The other bad thing though is that this is all within the main() function. C++ has classes and many other things available to it that could help break that down. There's not much to a hangman game, but perhaps some functions would help in this case. Smile
ArkPhaze
"Object oriented way to get rich? Inheritance"
Getting Started: C/C++ | Common Mistakes
[ Assembly / C++ / .NET / Haskell / J Programmer ]

Reply

RE: Hangman, the command line game.[C++] #29
@ArkPhaze
Thanks, this really helped. And I'll look into the matter.
I'm really not sure why i didn't make function, maybe I'll do it someday.
This is rather useless code snippet though


Reply







Users browsing this thread: 1 Guest(s)