Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
P
puzzleplayer
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Floris
puzzleplayer
Commits
c32dc198
Commit
c32dc198
authored
4 months ago
by
bionic85
Browse files
Options
Downloads
Patches
Plain Diff
Binair naar Binary veranderd
parent
a2856307
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
PuzzlePlayer/Binary.cs
+5
-3
5 additions, 3 deletions
PuzzlePlayer/Binary.cs
PuzzlePlayer/Board.cs
+2
-1
2 additions, 1 deletion
PuzzlePlayer/Board.cs
PuzzlePlayer/PuzzlePlayer.cs
+1
-1
1 addition, 1 deletion
PuzzlePlayer/PuzzlePlayer.cs
with
8 additions
and
5 deletions
PuzzlePlayer/Bina
i
r.cs
→
PuzzlePlayer/Binar
y
.cs
+
5
−
3
View file @
c32dc198
...
...
@@ -11,15 +11,17 @@ namespace PuzzlePlayer_Namespace
* The empty space is a constant defined in the abstract Board class
*/
internal
class
Bina
i
r
:
Board
internal
class
Binar
y
:
Board
{
// constructor with baordSize parameter (default is set to 8 but can be changed)
public
Bina
i
r
(
int
boardSize
=
8
)
public
Binar
y
(
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
This diff is collapsed.
Click to expand it.
PuzzlePlayer/Board.cs
+
2
−
1
View file @
c32dc198
...
...
@@ -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
[,]
b
oard
To
Solve
)
public
B
oard
Solve
(
)
{
// two variables for storing the result and the next solveStep
int
[,]
result
=
boardToSolve
;
...
...
This diff is collapsed.
Click to expand it.
PuzzlePlayer/PuzzlePlayer.cs
+
1
−
1
View file @
c32dc198
...
...
@@ -33,7 +33,7 @@ namespace PuzzlePlayer_Namespace
private
void
SetUpPuzzleForms
()
{
puzzleForms
.
Add
(
new
PuzzleForm
(
new
Bina
i
r
()));
puzzleForms
.
Add
(
new
PuzzleForm
(
new
Binar
y
()));
}
private
void
SetUpUI
()
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment