CSharp · Console
using System;
public class Program
{
public static void Main()
{
Console.WriteLine("Hello World");
playerTwo();
playerTwo();
playerTwo();
playerTwo();
playerTwo();
playerTwo();
playerTwo();
playerTwo();
playerTwo();
playerTwo();
playerTwo();
playerTwo();
}
private static int playerOneScore = 1000;
private static Random rnd = new Random();
private static void playerTwo()
{
int attack = rnd.Next(1, 10);
//int playerOneScore = 1000; <-- don't set playerOneScore inside the method, as this line gets executed with every time calling this method so it again and again gets set to 1000
//int playerOneScores; <-- don't get the meaning of this one, so I removed it and I am changing the playerOneScore field
playerOneScore = playerOneScore - (1 * attack);
Console.WriteLine(playerOneScore.ToString());
}
}