I dont understand methods fully yet, and i dont know why is this happening... Im trying to make my code change ints to words, and i think this is the way to go.
namespace ConsoleApplication9
{
class Program
{
static void Main(string[] args)
{
Random r = new Random();
Console.WriteLine("Hi wanna play rock paper scissors?<press enter to continue>");
Console.ReadKey();
int user = 0;
int ai = r.Next(1, 4);
Console.WriteLine("Pick what youll show! (1-rock, 2-paper, 3-scissors) and press enter");
user = Convert.ToInt32(Console.ReadLine());
if (user > 3)
{
Console.WriteLine("ERROR! your number must be <= 3. <Press enter to close the program>");
goto end;
}
if (user == ai)
{
Console.WriteLine("Its a draw! <press enter to continue>");
goto end;
}
Console.WriteLine(user);
end:
Console.ReadKey();
}
public static string ntw (int user) //ntw: not all code paths return a value
{
if (user == 1)
return "rock";
if (user == 2)
return "paper";
if (user == 3)
return "scissors";
}
}
}
Thanks in advance.