Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
Tick-Tack-Trauma
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
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
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
Josua Oppermann
Tick-Tack-Trauma
Commits
1c592134
Commit
1c592134
authored
2 months ago
by
JimmyTheCat
Browse files
Options
Downloads
Patches
Plain Diff
endTurn changed to int return
parent
4437d3ad
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Board.java
+8
-6
8 additions, 6 deletions
Board.java
with
8 additions
and
6 deletions
Board.java
+
8
−
6
View file @
1c592134
...
...
@@ -71,18 +71,20 @@ public class Board extends Thread {
*
* @return current player won
*/
public
boolean
turnEnd
()
{
public
int
turnEnd
()
{
marks
++;
boolean
victory
=
victoryCheck
()
;
if
(
victory
&&
marks
>
4
)
{
System
.
out
.
println
(
"You win Player "
+
currentPlayer
);
int
endState
=
0
;
if
(
marks
>
4
&&
victoryCheck
()
)
{
//
System.out.println("You win Player " + currentPlayer);
players
[
currentPlayer
].
playerScoreInc
();
endState
=
1
;
}
else
if
(
marks
==
9
)
{
System
.
out
.
println
(
"A draw"
);
//System.out.println("A draw");
endState
=
2
;
}
else
{
currentPlayer
=
currentPlayer
==
1
?
0
:
1
;
}
return
victory
;
return
endState
;
}
/**
...
...
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