Please enable JavaScript to use CodeHS

Demos

Testing the GeoLocation Class


Rock, Paper, Scissors!


In this problem, you'll play a simple rock, paper, scissors game. First, you'll ask the user to pick rock, paper, or scissors. Then, you'll have the computer randomly choose one of the options. After that, print out the winner! You should keep playing the game until the user hits enter. Note: You'll need to implement a method called `String getWinner(String user, String computer)`. Luckily, you just wrote that in an earlier program! Here is a sample run of the program. ``` Enter your choice (rock, paper, or scissors):rock User: rock Computer: paper Computer wins! Enter your choice (rock, paper, or scissors):paper User: paper Computer: scissors Computer wins! Enter your choice (rock, paper, or scissors):scissors User: scissors Computer: paper User wins! Enter your choice (rock, paper, or scissors):rock User: rock Computer: rock Tie Enter your choice (rock, paper, or scissors): Thanks for playing! ```

The Blackjack Game