7th Oct 2023, 3:40 PM
abc
abc - avatar
3 Respostas
+ 3
You don't have quotes around the values. The system is looking for the names of the colors as is they are variables. For example... You have: if(color==red) Should be: if(color=="red")
7th Oct 2023, 3:55 PM
Ken S
Ken S - avatar
+ 2
Have a look at what the error message says: "The name red does not exist in the current context." Where did you define the color variables? You may also want to have a look at this one: https://learn.microsoft.com/en-us/dotnet/csharp/how-to/compare-strings It explains how to compare strings in C#.
7th Oct 2023, 3:53 PM
Lisa
Lisa - avatar
0
Thanks
7th Oct 2023, 3:57 PM
abc
abc - avatar