public static void Main(string[] args) { // int a = WinningBot.WinningBot.x; // foreach (var balance in new double[] {0.5, 0.7, 0.85, 1.0, 1.2, 1.4}) { // Set bots here int score1 = 0; int score2 = 0; int remaining = 0; int remainingMain = 0; for (int i = 0; i < 1000; i++) { SmartBot bot1 = new DynamiteBot.Program(); // IBot bot2 = new DynamiteBot.Program(); IBot bot2 = new WinProgram(); // bot2.balance = balance; var result = TestBots(bot1, bot2, false); if (result > 0) { score1++; } else if (result < 0) { score2++; } // TODO: Test runs 1000 games (each with both bots playing first to 1000), // Can't print every 50th game for WinningBot, as games take too long. // Change % 50 to % 1 for that if (i % 1 == 0) { Console.WriteLine($"{i}: {score1} - {score2}"); } // } } Console.WriteLine($"Final outcome balance: {score1} - {score2}"); }
/// <summary> /// Runs specified program with parameters. /// </summary> /// <param name="program">Program name</param> /// <param name="arguments">Program arguments</param> /// <returns> /// A <see cref="string"/> with output command result. /// </returns> public static StringBuilder RunCommand(WinProgram program, string arguments) => RunCommand(program.GetDescription(), arguments);
/// <summary> /// Runs specified program with parameters and options. /// </summary> /// <param name="program">Program name</param> /// <param name="arguments">Program arguments</param> /// <param name="options">Run Program options</param> public static void RunProgram(WinProgram program, string arguments, RunProgramOptions options = null) => RunProgram(program.GetDescription(), arguments, options ?? RunProgramOptions.Default);