Answer this question PLEASE

Discussion in 'Game programming' started by gillie24, Mar 16, 2010.

  1. gillie24

    gillie24 New Member

    Joined:
    Mar 16, 2010
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    0
    Question A

    You are required to create a game that will operate as follow

    • The player will guess a number between 1 and 9
    • The computer will then select a random number between 1 and 9
    • The program will then compare the two numbers and if they are equal the player wins and his/her score is increased by 1. if they are not equal the computer score is increased by 1.
    • The player can exit the game by entering -1. when this occurs the players score and the computer score is displayed on the screen and the overall winner is congratulated via an appropriate message on the screen.
    Question B

    You are required to modify the above game so that instead of guessing numbers the player will guess a three letter word. You are required to ensure that the word enter has only three characters, otherwise allow the user to try again. You are required to create an array of string of size 10 of with three letter words will displayed to the user at the beginning of the game from which the player will select a word.

    The word selected by the player and the one selected by the computer will be compared and the scoring is done similar to the one above. In case however, allow the user enter the number of times they desire to run the program.at the end of the game display the computer’s score and the player’s score and congratulation message to the overall winner.
     
  2. shabbir

    shabbir Administrator Staff Member

    Joined:
    Jul 12, 2004
    Messages:
    15,375
    Likes Received:
    388
    Trophy Points:
    83
    Moved to Game Programming
     
  3. Mike911

    Mike911 New Member

    Joined:
    Jun 6, 2010
    Messages:
    12
    Likes Received:
    0
    Trophy Points:
    0
    random number to chars till 3chars
    guess -> input 3 chars and verify them
    computer -> generate 3 random chars
     

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice