Thursday

Mandatory assignment

Part one - Desert Island

Download the assignment description here: https://github.com/behu-kea/first-semester-java/blob/master/lessons/week-04/Desert%20Island.docx

Part two - Rock Paper Scissors

You have to create a rock, paper, scissors game. The game should have two modes:

  1. Multiplayer - person vs person

  2. Singleplayer - person vs computer

Multiplayer

When playing in the multiplayer mode, the game should ask for the two players name.

Now the users will play 3 rounds. After the rounds a message should be printed that shows either who won or a message saying the game was a draw.

Singleplayer

When playing in singleplayer mode the user is playing against a computer. The user puts in his name and they now play three rounds. After the rounds a message should be printed that shows either who won or a message saying the game was a draw.

Player decides number of rounds

Let the player decide the number of rounds

Optional tasks

No draws

Make it so two players (person vs person and person vs computer) has to find a winner in each round. No draws!

Intelligent computer

Instead of just randomnly choosing sign (rock, paper or scissors). Look at the history of the other player and make a better informed selection. You could fx check

  • Which sign does the oponent use the most?

  • Which signs does the user play after he has played another sign. Fx he often plays rock after he has played scissor

  • Which signs does the user play after the opponent played another sign. Fx he often plays rock after the oponent played scissor

  • Maybe a combination

  • Try do some research on the topic:

    • https://www.reddit.com/r/LearnUselessTalents/comments/24dwag/how_to_win_at_rockpaperscissors_a_first_large/

    • https://www.inverse.com/mind-body/rock-paper-scissors-not-sports

    • https://arstechnica.com/science/2014/05/win-at-rock-paper-scissors-by-knowing-thy-opponent/

Rounds

Instead of just playing 10 games, what people often do is play 3 plays and then does a best of three games. Now you dont win by having most correct guesses but won the most games.

What if the game ends in a draw? Is that okay or should the finish to they have found a winner?

Last updated

Was this helpful?