js game 2
js game 2
function playGame() {
// 1. Get user's choice
let userChoice;
while (true) {
// Use prompt for browser, or simulate/use readline-sync for Node.js
// For simplicity, this example assumes a browser or you'll mentally input.
// In a browser, uncomment the line below:
// userChoice = prompt("Choose Rock, Paper, or Scissors:").toLowerCase();
// For this example, let's simulate a user's choice for a quick run:
// You can change this line to 'rock', 'paper', or 'scissors' to test:
userChoice = "rock"; // <-- CHANGE THIS TO TEST DIFFERENT CHOICES