For beginner practice I'm trying to create a simple loop that accepts a single character from the user, prints that character to the console and keeps doing that until the user enters 'R'.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace SimpleLoop
{
class Program
{
static void Main(string[] args)
{
char cplayerSelection = 'R';
while(cplayerSelection == 'R')
{
Console.WriteLine("Enter R, P, or S:");
cplayerSelection = (char)Console.Read();
Console.WriteLine(cplayerSelection);
}
}
}
}
How ever no matter what the user enters it only loops once end then exits. What do I need to change to continue the loop?