using System.Runtime.CompilerServices;
using System.Transactions;
namespace RockPaperScissors
static void Main(string[] args)
string playerName = "Player";
Console.WriteLine("Let's play rock, paper, scissors!");
Console.Write("Please enter your name: ");
playerName = Console.ReadLine();
Random randomNumber = new Random();
int computerChoice = randomNumber.Next(1, 4);
Console.WriteLine($"Okay {playerName}, let's play!");
Console.WriteLine("Make your choice by entering a number:\n1. Rock\n2. Paper\n3. Scissors");
int playerChoice = Convert.ToInt32(Console.ReadLine());
Console.WriteLine("Computer chose Rock.");
Console.WriteLine("Computer chose paper.");
Console.WriteLine("Computer chose scissors.");
if(playerChoice == computerChoice){
Console.WriteLine("It's a tie! No points!");
else if((playerChoice == 1 && computerChoice == 2) || (playerChoice == 2 && computerChoice == 3) || (playerChoice == 3 && computerChoice == 1)){
Console.WriteLine("Computer wins!");
RunningScore(playerPoints, computerPoints, playerName);
else if((playerChoice == 2 && computerChoice == 1) || (playerChoice == 3 && computerChoice == 2) || (playerChoice == 1 && computerChoice == 3)){
Console.WriteLine($"{playerName} wins!");
RunningScore(playerPoints, computerPoints, playerName);
Console.WriteLine("Would you like to play again? Y/N:");
string goAgain = Console.ReadLine();
Console.WriteLine("Thanks for playing! Here are the final scores:");
RunningScore(playerPoints, computerPoints, playerName);
static void RunningScore(int playerPoints, int computerPoints, string playerName){
Console.WriteLine($"Current score:\n{playerName}: {playerPoints}\nComputer: {computerPoints}");