Week7 IT217: Programming Language

profilekinjalr10

 

Read chapters 6-7. Run the two argument files to understand different ways of using arguments and the use of subroutine with numerical values to bring the values from the subroutine to the main program or not. Run also GuessMyNumber game from the module.

Modify the Guessing game from chapters 6-7 to play with 2 players instead of 1 player by showing input and stats for player 1 and player 2.
- To end the game: You can ask for number of games to be played at the beginning of the game or you can ask the user whether to continue after each game.
- Display number of guesses for each player in addition to average number of guesses for each play.
- Show which player wins the whole match based on who has the least average number of guesses after the total number of games selected is over.
- When each game is played, change the output to display that the last guess is correct. Example: Congratulations! 53 is correct!
- When the players reach the total number of games chosen, or when the player chooses not to continue, display either: "Match over! Player 1 wins!" , OR "Match over! Player 2 wins!" , OR "Match over! It's a tie!"

  • 2 months ago
  • 7
Answer(0)