Skip to content

Commit

Permalink
Fixes from last night
Browse files Browse the repository at this point in the history
  • Loading branch information
DavidBetteridge committed Oct 13, 2016
1 parent 45a50c0 commit 25c9f52
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 6 deletions.
2 changes: 1 addition & 1 deletion Connect4.AlphaBeta/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down
Binary file modified Connect4.pptx
Binary file not shown.
6 changes: 6 additions & 0 deletions Connect4.sln
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
6 changes: 6 additions & 0 deletions Connect4/Controllers/API/MakeMoveController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,12 @@ public async Task<IHttpActionResult> 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())
Expand Down
2 changes: 1 addition & 1 deletion Connect4/Views/Home/Index.cshtml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
@model IEnumerable<Connect4.ViewModels.TeamViewModel>

<meta http-equiv="refresh" content="5">
<h1>Teams</h1>
<table class="table table-hover table-striped">
<tr>
Expand Down
8 changes: 4 additions & 4 deletions Connect4Database/Reset.sql
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
--------------------------------------------------------------------------------------
*/

--DELETE FROM dbo.Game
--GO
DELETE FROM dbo.Game
GO

--DELETE FROM dbo.Players WHERE SystemBot = 0
--GO
DELETE FROM dbo.Players WHERE SystemBot = 0
GO
Binary file added Handouts.docx
Binary file not shown.

0 comments on commit 25c9f52

Please sign in to comment.