Answer this question PLEASE

gillie24's Avatar
Newbie Member
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 the end of the game display the computer’s score and the player’s score and congratulation message to the overall winner.
shabbir's Avatar, Join Date: Jul 2004
Go4Expert Founder
Moved to Game Programming
Mike911's Avatar, Join Date: Jun 2010
Go4Expert Member
random number to chars till 3chars
guess -> input 3 chars and verify them
computer -> generate 3 random chars