diff --git a/PuzzlePlayer/Binary.cs b/PuzzlePlayer/Binary.cs index 5f3271810fbaeff380489691771fba7be00d33c5..c3e39c20cef832037c9a8313c4869260964f4021 100644 --- a/PuzzlePlayer/Binary.cs +++ b/PuzzlePlayer/Binary.cs @@ -473,5 +473,9 @@ namespace PuzzlePlayer_Namespace return false; } + public override int getBoardBaseScore() + { + throw new NotImplementedException(); + } } } \ No newline at end of file diff --git a/PuzzlePlayer/Board.cs b/PuzzlePlayer/Board.cs index 0be6bef34576f9cb4664eb456292f74e94fa08e2..bab69e95c2da32ba0f8244fdb9fc065cb6fa7a30 100644 --- a/PuzzlePlayer/Board.cs +++ b/PuzzlePlayer/Board.cs @@ -60,7 +60,10 @@ namespace PuzzlePlayer_Namespace return result; } - + // abstract methode for obtaining the base score for this type of board + // certain puzzles might be easier to solve hence the base score can be set accordingly + // this way the score you get is balanced for every puzzle + public abstract int getBoardBaseScore(); public abstract void Draw(Graphics gr, Rectangle r); diff --git a/PuzzlePlayer/Maze.cs b/PuzzlePlayer/Maze.cs index e533f65c0049fa74419d86a46f43c6c261e94e32..f1afe6fdfa2ea6b7be3374f33a0cf18c324088d6 100644 --- a/PuzzlePlayer/Maze.cs +++ b/PuzzlePlayer/Maze.cs @@ -417,5 +417,10 @@ namespace PuzzlePlayer_Namespace //MessageBox.Show($"{Convert.ToString(playerPos)} moet bij {Convert.ToString(new Point(boardState.GetLength(0) - 1, boardState.GetLength(1)))}"); return playerPos == new Point(boardState.GetLength(0) - 1, boardState.GetLength(1) - 1); } + + public override int getBoardBaseScore() + { + return 5; + } } } diff --git a/PuzzlePlayer/Minesweeper.cs b/PuzzlePlayer/Minesweeper.cs index 2e56064390125a2ef32e9c0a8c8d7b5edd1e41c5..06422e78007015ff993eaeb776dd8a49491ebd54 100644 --- a/PuzzlePlayer/Minesweeper.cs +++ b/PuzzlePlayer/Minesweeper.cs @@ -168,5 +168,10 @@ namespace PuzzlePlayer_Namespace for (int i = 0; i < boardState.GetLength(0); i++) for (int j = 0; j < boardState.GetLength(1); j++) if (boardState[i, j] == emptySpace) boardState[i, j] = -2; return true; } + + public override int getBoardBaseScore() + { + throw new NotImplementedException(); + } } } diff --git a/PuzzlePlayer/PuzzleForm.cs b/PuzzlePlayer/PuzzleForm.cs index 4b2fbfe93e2a67380ceb238520e7e147c158ea1e..7b9284d00aae6f6d124d0dd28221b681361abbb1 100644 --- a/PuzzlePlayer/PuzzleForm.cs +++ b/PuzzlePlayer/PuzzleForm.cs @@ -24,6 +24,8 @@ namespace PuzzlePlayer_Namespace private readonly ToolStripMenuItem menuSettings; private readonly BufferedGraphics bufferedGraphics; private Board board; + private int score = 0; + public Board Board //updating the Board member will immediately call board.Draw method so that the board is updated visually { get { return board; } diff --git a/PuzzlePlayer/Skyscrapers.cs b/PuzzlePlayer/Skyscrapers.cs index a1e07844e71978d40386202fe9ae2feb4bcb9097..3206d18858676775c5de15a2960fbae368673235 100644 --- a/PuzzlePlayer/Skyscrapers.cs +++ b/PuzzlePlayer/Skyscrapers.cs @@ -115,5 +115,10 @@ namespace PuzzlePlayer_Namespace { return new List<Move>(); } + + public override int getBoardBaseScore() + { + throw new NotImplementedException(); + } } } diff --git a/PuzzlePlayer/Sudoku.cs b/PuzzlePlayer/Sudoku.cs index ebfb05beb9e66cb2db9b4310198b2d88fb8a483f..e2424492c560e38f045d5857ebff38c792f281d5 100644 --- a/PuzzlePlayer/Sudoku.cs +++ b/PuzzlePlayer/Sudoku.cs @@ -15,6 +15,7 @@ namespace PuzzlePlayer_Namespace private static int boardLength; private static int rootBoardLength; private static Random random = new Random(); + private double removeDensity = 0.5; public Sudoku(int boardSize = 4) { boardState = GetClearBoard(boardSize, boardSize); @@ -24,6 +25,7 @@ namespace PuzzlePlayer_Namespace description = "Sudoku is played on any perfect square-numbered grid, with some cells initially containing numbers. The goal of the puzzle is to fill all cells such that:\r\nâ— Each row and column must contain all of the numbers exactly once\r\nâ— Each box indicated by thicker lines must also contain all of the numbers exactly once\r\nâ— Every sudoku must have an unique solution"; drawFactor = 1; + } public override void Draw(Graphics gr, Rectangle r) @@ -108,7 +110,7 @@ namespace PuzzlePlayer_Namespace solution = (int[,])boardState.Clone(); - RemoveSpaces((int)(boardLength * boardLength * 0.5)); + RemoveSpaces((int)(boardLength * boardLength * removeDensity)); lastGeneratedBoard = (int[,])boardState.Clone(); } @@ -343,5 +345,9 @@ namespace PuzzlePlayer_Namespace return result; } + public override int getBoardBaseScore() + { + throw new NotImplementedException(); + } } } diff --git a/PuzzlePlayer/vaag balanceing ding.txt b/PuzzlePlayer/vaag balanceing ding.txt new file mode 100644 index 0000000000000000000000000000000000000000..eb50efb9dae905478251fc788376d13ff7175a1f --- /dev/null +++ b/PuzzlePlayer/vaag balanceing ding.txt @@ -0,0 +1,7 @@ +sudoku 100 dif: dichtheid%(groote*groote*0.5) * groote(9)^2 +minesweeper 90 +binair 80 +maze 70 + +score = baseScore * (FdificutlyBonus - timePenalty) +