Skip to content

Help in making a program

lolz lolz

Asked Jun 11, 2008, 6:10 AM EDT8 answers
Share
LinkedInX
Here is the GUI:

[URL=http://img403.imageshack.us/my.php?image=guessawordjo5.jpg][IMG]http://img403.imageshack.us/img403/4409/guessawordjo5.th.jpg[/IMG][/URL]


I am making a program, same as hang man, a word guessing game.

This program is for the player to guess a word consists of 4 alphabets.
When the player guess correctly, a '0' will show in the list box with the correct position of the word.
When the player guess wrongly, a 'X' will show in the list box with the correct position of the word.
When the player guess correctly the word, a message will appear tellin the player the number of tries.

8 Answers

Know the answer? Post it. Somebody with the same question will find it here.

  • Mahesh Chand
    0
    Check out Games section of this site. It has several games something like you are looking for. Download the source code and make necessary changes you need. Don't forget to upload your version of project ;)
    0
  • 0
    can anyone help lolz lolz in constructing the Word Guessing Game program...????its quite difficult, i have tried and am stuck...help please????
    0
  • 0
    if anyone know where a sample source codes is similar to the word guessing game. Please post the url so that i can have a look instead of askin me to search. Thanks
    0
  • 0
    hey lolz lolz...can u help me out with the program that ur tryin to do....how much hav u done alreadi....let me noe yeah....cheerz!!
    0
  • 0
    I do not see the hard part here.

    So you have a textbox TXT_INPUT that you get the entered text from by calling TXT_INPUT.Text on a button press, or by capturing the keydown event since all you want is a single character. Incrementsome sort of counter as well so you know how many guesses have been made and can then end the game or make high scores or something. Also would be useful in a generic "draw hangman" function which just looks at this integer and draws the figure appropriately. If it is 0, then draw everything, if 1 then draw all but leg A, if 2 then draw all but leg B and so on.

    ===========================
    string myKnownWord = "c# corner";
    List<char> guessedCharacters = new List<char>();
    int hangmanStage = 0;



    bool isFound = false;
    char[] myKnownWordArray = myKnownWord.ToLower().ToCharArray();
    guessedCharacters.Add(TXT_INPUT.Text.ToLower().ToCharArray()[0]);
    hangmanstage++;
    string outputString = "";
    for(int i = 0; i < myKnownWordArray.Length; i++)
    {
      if(guessedCharacters.Contains(myKnownWordArray[i]))
      {
        outputString += "0";
      } else {
        outputString += "X";
      }
    }
    UpdateHangmanGraphics(hangmanstage);
    return outputString;

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

    So the top are globals, the bottom is what you do when the user guesses. Take the string it returns and add it to the listbox...

    You could make it a string where if guessed then add the actual character to the array, otherwise add an underscore or something like that to make it more hangman-esque.
    0
  • 0
    hey Nick...if you check out his GUI....its totally different from the hangman game.....if you or anyone has any ideas; i'm all ears.....tanx man!
    0
  • 0

    ya!!! me too.. i am also doin a similar project exactly like yours. but i am stuck and am not sure how to do.... is there anyone who can help me out or any source code which is available??? please send it to [email protected] or add me at me hotmail address!!! :D

    0