From a7e5f87d112af2b4375fc36ce1f4c54944496fee Mon Sep 17 00:00:00 2001 From: bionic85 <144353436+bionic85@users.noreply.github.com> Date: Wed, 8 Jan 2025 15:00:47 +0100 Subject: [PATCH] begonnen met geld geef ding --- PuzzlePlayer/Binary.cs | 4 ++++ PuzzlePlayer/Board.cs | 5 ++++- PuzzlePlayer/Maze.cs | 5 +++++ PuzzlePlayer/Minesweeper.cs | 5 +++++ PuzzlePlayer/PuzzleForm.cs | 2 ++ PuzzlePlayer/Skyscrapers.cs | 5 +++++ PuzzlePlayer/Sudoku.cs | 8 +++++++- PuzzlePlayer/vaag balanceing ding.txt | 7 +++++++ 8 files changed, 39 insertions(+), 2 deletions(-) create mode 100644 PuzzlePlayer/vaag balanceing ding.txt diff --git a/PuzzlePlayer/Binary.cs b/PuzzlePlayer/Binary.cs index 5f32718..c3e39c2 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 0be6bef..bab69e9 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 e533f65..f1afe6f 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 2e56064..06422e7 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 4b2fbfe..7b9284d 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 a1e0784..3206d18 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 ebfb05b..e242449 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 0000000..eb50efb --- /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) + -- GitLab