diff --git a/Connect4.AlphaBeta/Program.cs b/Connect4.AlphaBeta/Program.cs index b7a4fb2..5c1a88c 100644 --- a/Connect4.AlphaBeta/Program.cs +++ b/Connect4.AlphaBeta/Program.cs @@ -7,7 +7,7 @@ namespace Connect4.ExampleBot class Program { // Put the name of your team here - private const string teamName = "AlphaBeta"; + private const string teamName = "David's AlphaBeta"; // and a password for your team here. This is to prevent cheating! private const string teamPassword = "MyPassword"; diff --git a/Connect4.pptx b/Connect4.pptx index a27cab4..a6d4782 100644 Binary files a/Connect4.pptx and b/Connect4.pptx differ diff --git a/Connect4.sln b/Connect4.sln index eb91e4c..1053433 100644 --- a/Connect4.sln +++ b/Connect4.sln @@ -17,6 +17,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Connect4.LookAhead", "Conne EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Connect4.AlphaBeta", "Connect4.AlphaBeta\Connect4.AlphaBeta.csproj", "{BAB54F01-B14F-466E-B75D-A69E70737F43}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Connect4.MonteCarlo", "Connect4.MonteCarlo\Connect4.MonteCarlo.csproj", "{53F0D56F-E55C-4CEE-9F96-52E52F3B7386}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -53,6 +55,10 @@ Global {BAB54F01-B14F-466E-B75D-A69E70737F43}.Debug|Any CPU.Build.0 = Debug|Any CPU {BAB54F01-B14F-466E-B75D-A69E70737F43}.Release|Any CPU.ActiveCfg = Release|Any CPU {BAB54F01-B14F-466E-B75D-A69E70737F43}.Release|Any CPU.Build.0 = Release|Any CPU + {53F0D56F-E55C-4CEE-9F96-52E52F3B7386}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {53F0D56F-E55C-4CEE-9F96-52E52F3B7386}.Debug|Any CPU.Build.0 = Debug|Any CPU + {53F0D56F-E55C-4CEE-9F96-52E52F3B7386}.Release|Any CPU.ActiveCfg = Release|Any CPU + {53F0D56F-E55C-4CEE-9F96-52E52F3B7386}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/Connect4/Controllers/API/MakeMoveController.cs b/Connect4/Controllers/API/MakeMoveController.cs index 49e2f34..5fc6d26 100644 --- a/Connect4/Controllers/API/MakeMoveController.cs +++ b/Connect4/Controllers/API/MakeMoveController.cs @@ -30,6 +30,12 @@ public async Task POST(Guid playerID, int columnNumber, strin var game = await database.LoadGame(player.CurrentGameID.Value); if (game == null) return BadRequest("Your player is not currently playing a game. Call NewGame"); + + if (game.CurrentState != Models.GameState.RedToPlay && game.CurrentState != Models.GameState.YellowToPlay) + { + throw new Exception("This game is not playable"); + } + // Is it the players turn var playerIsYellow = (game.YellowPlayerID == player.ID); if (playerIsYellow && !game.YellowToPlay()) diff --git a/Connect4/Views/Home/Index.cshtml b/Connect4/Views/Home/Index.cshtml index a158695..cc779e0 100644 --- a/Connect4/Views/Home/Index.cshtml +++ b/Connect4/Views/Home/Index.cshtml @@ -1,5 +1,5 @@ @model IEnumerable - +

Teams

diff --git a/Connect4Database/Reset.sql b/Connect4Database/Reset.sql index 0f800bd..7d64cb6 100644 --- a/Connect4Database/Reset.sql +++ b/Connect4Database/Reset.sql @@ -10,8 +10,8 @@ -------------------------------------------------------------------------------------- */ ---DELETE FROM dbo.Game ---GO +DELETE FROM dbo.Game +GO ---DELETE FROM dbo.Players WHERE SystemBot = 0 ---GO \ No newline at end of file +DELETE FROM dbo.Players WHERE SystemBot = 0 +GO \ No newline at end of file diff --git a/Handouts.docx b/Handouts.docx new file mode 100644 index 0000000..264e995 Binary files /dev/null and b/Handouts.docx differ