public static void Main()
const int touchdownValue = 6;
const int extrapointValue = 1;
const int fieldgoalValue = 3;
Console.WriteLine("Enter the number of touchdowns scored by the home team:");
int homeTouchdowns = int.Parse(Console.ReadLine());
Console.WriteLine("Enter the number of extra points scored by the home team:");
int homeExtrapoints = -1;
while(homeExtrapoints == -1) {
homeExtrapoints = int.Parse(Console.ReadLine());
if (homeExtrapoints > homeTouchdowns) {
Console.WriteLine("A team cannot score more extra points attempts than number of touchdowns.");
Console.WriteLine("Enter the number of extra points scored by the home team:");
Console.WriteLine("Enter the number of field goals scored by the home team:");
int homeFieldgoals = int.Parse(Console.ReadLine());
touchdownValue * homeTouchdowns +
extrapointValue * homeExtrapoints +
fieldgoalValue * homeFieldgoals;
Random randomGenerator = new Random();
int awayTouchdowns = randomGenerator.Next(7);
int awayExtrapoints = randomGenerator.Next((awayTouchdowns == 0 ? 0 : awayTouchdowns + 1));
int awayFieldgoals = randomGenerator.Next(7);
touchdownValue * awayTouchdowns +
extrapointValue * awayExtrapoints +
fieldgoalValue * awayFieldgoals;
Console.WriteLine("Home Team: " + homeScore);
Console.WriteLine("Away Team: " + awayScore);
Console.WriteLine((homeScore > awayScore ? "Hurray, the home team won!" : (homeScore == awayScore ? "A tie in football?!" : "Clearly, the refs were playing for the away team")));