none
Hangman game in C++

    Question

  • Hello, I'm trying to make a game called Hangman in c++. My professor has thrown me into the ocean and I could say I do not know how to swim because he did not teach me how to swim. I'm trying to teach myself how to swim in c++ but it’s not going to well. My professor has not left me with any tutorials at all on how to do this project.

    Unlike my other CIT classes my other professors have left me tutorials, book work, and their own personal guides on "How to do stuff" for the subject.

    I do not know where to start for my Hangman game. Correction. I have a few cout statements but other than that I do not even know what else I need for the game. I've looked on YouTube and haven't found anything useful to help me understand how to successfully build this game for my final grade. 

    I think it’s silly I take a college online class and I’m just where I was before. I would sit there and try to teach myself c++ through tutorials online but they aren't good enough to show me what I need to learn about the usage of visual studios with c++ so I can replicate the program to make it. I learn through seeing people do things and I know it’s as my professor says “he doesn't want to show the me the answers but that’s the same thing with Math. You see the problem on the board you learn how to do it you replicate it. That’s how I learn and my programming professor has not really understood that. I have nothing that has been shown to me to be a guide so I can replicate what I’m doing to make my Hangman game.

    Final

    Create the video game hangman in the command prompt while meeting the following requirements:

    • Require the user to input letters only. Allow upper or lower case letters.
    • Randomly select between at least 5 words for the user to guess. Keep a theme (e.g. animals, foods, philosophers, etc).
    • All words should be at least 5 characters.
    • Display a message when the user incorrectly guesses a letter.
    • Display a message when the user correctly guesses a letter.
    • Display all previously guessed letters so the user doesn't guess them again.
    • Allow the user to incorrectly answer 6 times before displaying a game over message. (head, body, arms, legs)
    • Display a congratulations message if the user wins.
    • Prompt the user to play again once their game is over.
    • Display correctly guessed letters with Xs in place of the unguessed letters (e.g. ProXraXXinX = Programming with G and M unguessed)
    • You don't have to draw the actual hanging man.

    If someone could help me understand how to build this program I’d greatly appreciate it. I do not care if someone shows me the answers or makes it for me. I'm very open about saying that because I want a better understanding of how to code in c++, what to use, and how to use it. I’d at least like a guide on how to make it and why the things that are used in the code are used they way they are to understand the usage for the Hangman game. I want to know how to do it so I can then later on in my future use what the Hangman game uses as a way to understand what I’m learning.

    If I don’t see anything then I have nothing to go off of and its just me kind of sitting their not even being close to getting a Hangman game complete because I don’t have a template or anything. So with that said would anyone be willing to walk me through the process of how to build a Hangman game without the actual hangman being displayed.

    I understand its not my professors fault that I don't understand how to do this I only blame myself. I have read the book and read the chapters each over 2 to 3 times and I still do not understand the information presented to me. I also tried getting outside sources like going to barnes and nobles and looking at other books with c++ information to try to understand how to use c++ in visual studios.


    • Edited by Starlyn Saturday, December 07, 2013 9:52 PM
    Saturday, December 07, 2013 9:34 PM

Answers

All replies

  • The webpage below has 10 c++ projects including hangman.  I wouldn't look at the hangman project, instead use one of the other projects as a model.  The teacher is well aware of this website and I wouldn't worry too much about copying the projects.  Usually as a 1st computer project the teacher normally will just tell students to copy an existing project to learn how to use the compiler.

    I can help I there is anything you don't understand.

    http://www.codeincodeblock.com/2012/04/list-of-top-ten-college-mini-projects.html


    jdweng

    Saturday, December 07, 2013 10:04 PM

  • C++ Tips and Tricks (AKA how to get a good grade in this class)

    Posted on: Tuesday, August 27, 2013

    1. Execute all your programs. If they don't execute, that's points off. Place a system("PAUSE"); command before your final return statement to make your console window freeze. What do you do if it won't execute? Keep reading.

    2. Learn to debug. It focuses on Visual Studio 2008 but the debugging is the same for 2010 and 2012. You can ignore the "Arrays" section until you get to that chapter in the book. Also, this tutorial is in C# but the syntax is so similar you might not notice. I spend a large majority of my time debugging, especially when I'm supporting someone else's code and I have to figure out what they were doing. No one taught me how to debug properly until I got into the industry. I don't want the same for you.

    3. Pay attention to error messages and Google them if you don't understand. If your program won't compile, the compiler will typically tell you why or give you a clue. If you aren't sure what it needs Google the message it provides. Thousands of people have probably had the same error and the programming community is always looking to help out.

    4. Look up examples. Feel free to Google C++ examples. Don't sweat the syntax. Focus on the major concepts and ideas. Syntax will follow. If you have Google code examples (or have to look in your book) to replicate someone else's code...Do It! The only time you might have to code from pure memory is during a job interview. Most employers will ask you logical questions and will even accept psuedocode.

    5. Check the discussion boards. Someone might have already asked this question and the answer could just be sitting there waiting for you to read it!
    Okay, none of the above worked. Now what?

    6.  Ask your classmates/instructor. Hit the discussion boards with your questions. If it's not a personal question and/or doesn't show the entire answer, put it on the discussion boards so we only have to answer the question once. This is a more efficient than me answering the same question 15 times in emails and makes your classmates more independent. When you're collaborating with a programming team they won't have time to fix all your problems so you might as well learn how to fix them yourself early!

    If you do all of the above I don't see how you can get less than an A in this course.
    As you've probably noticed every assignment is open to you now. Feel free to work ahead.

    Well this is what was posted in the Announcement from my professor. Thank you. For the reply I appreciate it. 

    Sunday, December 08, 2013 12:42 AM

  • C++ Tips and Tricks (AKA how to get a good grade in this class)

    Also, this tutorial is in C# but the syntax is so similar you might not notice.


    Not a good way to teach beginners how to program in C++ - they shouldn't have to convert
    from C# to C++ themselves. Especially if C# hasn't been listed as a prerequisite for this
    C++ course.

    - Wayne

    Sunday, December 08, 2013 2:40 AM
  • (Hopefully I can edit and post link now)

    This was the link that went alongside that for some reason I do not see a verify account in my email yet to post links and images.

    Just wanted to make it clear that this was missing from what you commented on. I apologize for the missing information. I just want to get my project done and the information I have is useless. I can only push it aside and look for new information on what I'm trying to accomplish rather than pondering on information that is useless to me. 

    The link would be ->

     (3 w's) (dot net perls) without spaces and then ( period ) (c o m ) with a ( / ) (debugging)

    And I agree with you and understand. I literally email the guy telling him what I need help with and very vague tells me what to do just enough to give hints but not enough to fully comprehend what I need to do in my code to change it the way I need it to be done to get the program to execute for other projects. It's been kind of helpful but he's not really telling me stuff that I don't already know myself. 


    Sunday, December 08, 2013 5:34 AM
  • when I went to college as an upper classman I helped lots of beginner programmers and know the assignments very well.

    jdweng

    Sunday, December 08, 2013 7:20 AM
  • The other site is missing a txt file. Which I'm not too sure about how to include those into what I'm making. I'm trying to figure out how to use text files with streams, sstream, & fstream.

    Do I just need to make a list of words for this txt file that I'll be making with my own words? I tried that and it didn't seem to work.

    =========================================================

    This is what I have left to do in my project. I'm still working through it. 

    1. Require the user to input letters only.Allow upper or lower case letters.
    2. Allow the user to incorrectly answer 6 times before displaying a game over message. (head, body, arms, legs)
    3. Display correctly guessed letters with Xs in place of the unguessed letters(e.g.ProXraXXinX = Programming with G and M unguessed)

    There's not too much left. I think I have a good start now. Definitely need to put more time into it but, I might have it working. 



    • Edited by Starlyn Sunday, December 08, 2013 4:54 PM
    Sunday, December 08, 2013 4:01 PM
  • My professor has thrown me into the ocean and I could say I do not know how to swim because he did not teach me how to swim. I'm trying to teach myself how to swim in c++ but it’s not going to well. My professor has not left me with any tutorials at all on how to do this project.

    How come? You're paying for the tuition and got nothing? Complain. This is an important exercise in Human engineering.

    -- pa

    Sunday, December 08, 2013 5:48 PM
  • The text file just has one word per line.  Just make sure you include the entire path to the file like c:\temp\abc.txt.

    jdweng

    Sunday, December 08, 2013 7:39 PM
  • I understand about complaining this semester was just unique. I got a concepts of programming book again and went through it. It definitely helped clear up some of the loose ends that were missing in me understanding some of things I was working on with c++. I turned in my assignment. 
    • Edited by Starlyn Friday, December 20, 2013 1:44 AM
    Monday, December 09, 2013 2:11 AM