public void Part1GamePlayWorksOnExample() { var(player1, player2) = CrabCombat.LoadGame("example1.txt"); var(result1, result2) = CrabCombat.PlayGame(player1, player2); result1.ShouldBeEmpty(); result2.ShouldBe(new List <int> { 3, 2, 10, 6, 8, 5, 9, 4, 7, 1 }); }
public void Part1GamePlayWorksOnRealInput() { var(player1, player2) = CrabCombat.LoadGame("input.txt"); var(result1, result2) = CrabCombat.PlayGame(player1, player2); result1.ShouldBeEmpty(); result2.ShouldBe(new List <int> { 47, 30, 43, 22, 44, 31, 32, 17, 36, 24, 27, 9, 5, 2, 50, 37, 39, 21, 45, 15, 11, 1, 49, 41, 26, 14, 46, 38, 25, 7, 48, 12, 23, 6, 34, 33, 16, 3, 42, 29, 40, 19, 35, 28, 20, 10, 18, 8, 13, 4 }); }
public override string First() { string filename = GetFilename(); List <string> input = System.IO.File.ReadAllLines(filename).ToList(); PRINT = false; CrabCombat game = new CrabCombat(input); game.PlayGame(); var result = game.Score(); return(result.ToString()); }
public override bool Test() { string filename = GetTestFilename(); List <string> input = System.IO.File.ReadAllLines(filename).ToList(); PRINT = false; CrabCombat game = new CrabCombat(input); game.PlayGame(); var result = game.Score(); bool testSucceeded = result == 306; return(testSucceeded); }
public void ScoreCalculatorWorksOnRealInput() { var(player1, player2) = CrabCombat.LoadGame("input.txt"); var(result1, result2) = CrabCombat.PlayGame(player1, player2); CrabCombat.CalculateScore(result2).ShouldBe(35397); }
public void ScoreCalculatorWorksOnExample() { var(player1, player2) = CrabCombat.LoadGame("example1.txt"); var(result1, result2) = CrabCombat.PlayGame(player1, player2); CrabCombat.CalculateScore(result2).ShouldBe(306); }