From c32dc198e19933ac76ac6afcdbc5cdc04ab33794 Mon Sep 17 00:00:00 2001 From: bionic85 <144353436+bionic85@users.noreply.github.com> Date: Wed, 20 Nov 2024 11:23:07 +0100 Subject: [PATCH] Binair naar Binary veranderd --- PuzzlePlayer/{Binair.cs => Binary.cs} | 8 +++++--- PuzzlePlayer/Board.cs | 3 ++- PuzzlePlayer/PuzzlePlayer.cs | 2 +- 3 files changed, 8 insertions(+), 5 deletions(-) rename PuzzlePlayer/{Binair.cs => Binary.cs} (96%) diff --git a/PuzzlePlayer/Binair.cs b/PuzzlePlayer/Binary.cs similarity index 96% rename from PuzzlePlayer/Binair.cs rename to PuzzlePlayer/Binary.cs index 2c38c4f..defa72c 100644 --- a/PuzzlePlayer/Binair.cs +++ b/PuzzlePlayer/Binary.cs @@ -11,15 +11,17 @@ namespace PuzzlePlayer_Namespace * The empty space is a constant defined in the abstract Board class */ - internal class Binair : Board + internal class Binary : Board { // constructor with baordSize parameter (default is set to 8 but can be changed) - public Binair(int boardSize = 8) + public Binary(int boardSize = 8) { // create a board with the specifide size boardState = new int[boardSize,boardSize]; + Info = ""; + // clear the board (fill it in with -1) Clear(); } @@ -76,4 +78,4 @@ namespace PuzzlePlayer_Namespace throw new NotImplementedException(); } } -} +} \ No newline at end of file diff --git a/PuzzlePlayer/Board.cs b/PuzzlePlayer/Board.cs index f229134..d0658e1 100644 --- a/PuzzlePlayer/Board.cs +++ b/PuzzlePlayer/Board.cs @@ -16,6 +16,7 @@ namespace PuzzlePlayer_Namespace public abstract class Board { protected const int emptySpace = -1; // for every puzzle -1 represents a empty space + public string Info; // a property for getting and setting the boardsstate. The boardstate should only be setted if the imputed int[,] is valid. public int[,] boardState @@ -25,7 +26,7 @@ namespace PuzzlePlayer_Namespace } // a methode for solving the whole board. It uses the private SolveStep methode untill the whole board is solved - public int[,] Solve(int[,] boardToSolve) + public Board Solve() { // two variables for storing the result and the next solveStep int[,] result = boardToSolve; diff --git a/PuzzlePlayer/PuzzlePlayer.cs b/PuzzlePlayer/PuzzlePlayer.cs index 44011a4..4daa9ba 100644 --- a/PuzzlePlayer/PuzzlePlayer.cs +++ b/PuzzlePlayer/PuzzlePlayer.cs @@ -33,7 +33,7 @@ namespace PuzzlePlayer_Namespace private void SetUpPuzzleForms() { - puzzleForms.Add(new PuzzleForm(new Binair())); + puzzleForms.Add(new PuzzleForm(new Binary())); } private void SetUpUI() -- GitLab