diff --git a/GAME.md b/GAME.md index 0f395ac..f350626 100644 --- a/GAME.md +++ b/GAME.md @@ -54,8 +54,7 @@ The top left corner has the coordinate (0,0). The X coordinate increases to the 1. When your program first runs via the Tester it will send a line with the sizes of the grid 2. Then it will send the entire grid 3. The first dice -4. A 2 in the grid means its a bonus space -5. You cannot place numbers on 0's +4. You cannot place numbers on 0's After that you send the response back in the following format @@ -64,58 +63,58 @@ p , Heres a example loop: ``` -7 8 22 -0 0 1 1 1 1 0 0 -0 1 1 1 1 1 1 0 +8 7 22 +1 1 1 0 0 1 3 1 1 1 1 1 1 1 1 1 -2 1 1 1 1 1 1 2 +0 3 1 1 1 1 1 0 +0 1 1 0 0 1 1 0 +0 1 1 1 3 1 1 0 1 1 1 1 1 1 1 1 -0 1 1 1 1 1 1 0 -0 0 1 1 1 1 0 0 -d 2 4 -p 2 3,0 -d 2 3 -p 2 1,3 +1 2 1 0 0 1 2 1 +d 6 1 +p 6 2,3 +d 3 4 +p 3 2,4 +d 6 1 +p 6 1,1 +d 3 6 +p 3 1,5 +d 6 4 +p 6 0,5 +d 3 3 +p 3 1,3 +d 2 5 +p 2 1,2 +d 3 1 +p 3 0,6 d 1 1 -p 1 2,4 +p 1 3,5 +d 1 6 +p 1 1,4 +d 1 1 +p 1 3,1 +d 1 2 +p 1 2,1 +d 4 3 +p 4 0,0 +d 6 3 +p 6 3,4 +d 5 2 +p 5 1,6 +d 6 6 +p 6 0,1 d 5 4 p 5 2,2 +d 4 5 +p 4 3,2 d 5 5 -p 5 2,3 -d 2 3 -p 2 2,5 -d 1 5 -p 1 2,6 -d 3 1 -p 3 0,2 -d 5 3 -p 5 0,3 -d 5 1 -p 5 1,4 -d 5 2 -p 5 3,2 -d 4 1 -p 4 3,6 -d 5 4 -p 5 3,4 -d 2 3 -p 2 2,1 -d 2 2 -p 2 3,3 -d 3 5 -p 3 1,2 +p 5 2,6 +d 1 2 +p 1 2,5 d 3 4 -p 3 1,1 -d 2 5 -p 2 3,1 -d 1 5 -p 1 2,0 -d 2 1 -p 2 3,5 -d 2 5 -p 2 1,5 -d 1 4 -p 1 0,4 +p 3 2,0 +d 2 3 +p 2 1,0 ``` The only thing you have to send is the p's the rest is what you recieve excep for the last p diff --git a/Source/Example/Program.cs b/Source/Example/Program.cs index 945ba39..e0b7c49 100644 --- a/Source/Example/Program.cs +++ b/Source/Example/Program.cs @@ -23,6 +23,7 @@ Thread.Sleep(10); var roll = Console.ReadLine(); if (roll == null) continue; + Console.WriteLine(roll); var nums = roll.Split(" "); var first = Int32.Parse(nums[1]); diff --git a/Source/Tester/Program.cs b/Source/Tester/Program.cs index a0efc6a..196d124 100644 --- a/Source/Tester/Program.cs +++ b/Source/Tester/Program.cs @@ -77,19 +77,12 @@ static async Task PlayAsync(Grid grid, string command) var points = game.GetPoints(); Logger.Log(Print2dMatrix(game.State)); try - { - process.Close(); - } - catch (Exception e) - { - //pass - } - try { process.Kill(); - + process.Close(); + process.Dispose(); } - catch (Exception e) + catch (Exception) { //pass } @@ -121,8 +114,6 @@ static async Task PlayAsync(Grid grid, string command) return await tcs.Task; } - - static bool IsWindows() { return System.Runtime.InteropServices.RuntimeInformation.IsOSPlatform(System.Runtime.InteropServices.OSPlatform.Windows); diff --git a/Source/Tests/ScoreTests.cs b/Source/Tests/ScoreTests.cs index e147c0f..7c3fdf1 100644 --- a/Source/Tests/ScoreTests.cs +++ b/Source/Tests/ScoreTests.cs @@ -17,15 +17,15 @@ public class ScoreTests }; public static readonly int[,] GridE = { - {0,1,1,1,1,0 }, - {3,1,1,3,1,1 }, - {0,1,1,1,1,0 }, + { 0,1,1,1,1,0 }, + { 3,1,1,3,1,1 }, + { 0,1,1,1,1,0 }, }; public static readonly int[,] GridF = { - {3,3}, - {1,1}, - {2,2} + { 3,3 }, + { 1,1 }, + { 2,2 } }; private static int CalculatePoints(int[,] grid, int[,] state) @@ -110,13 +110,13 @@ public void TestBigGrid() { int[,] state = { - {1,1,1,0,0,1,3,1 }, - {1,1,3,3,3,1,1,1 }, - {0,6,1,1,1,1,5,0 }, - {0,1,1,0,0,3,5,0 }, - {0,1,1,1,6,5,5,0 }, - {1,1,1,1,2,2,5,1 }, - {2,2,1,0,0,1,2,1 }, + { 1,1,1,0,0,1,3,1 }, + { 1,1,3,3,3,1,1,1 }, + { 0,6,1,1,1,1,5,0 }, + { 0,1,1,0,0,3,5,0 }, + { 0,1,1,1,6,5,5,0 }, + { 1,1,1,1,2,2,5,1 }, + { 2,2,1,0,0,1,2,1 }, }; Assert.Equal(15, CalculatePoints(Grids.GridB, state));