Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Privacy
Imprint
Contact
Login methods
Sign in
Toggle navigation
Menu
Open sidebar
Mehmet Duhan Tercüman
Connect_Four
Commits
e21738ab
Commit
e21738ab
authored
Jun 24, 2021
by
Mehmet Duhan Tercüman
Browse files
Vier gewinnt
parent
170e68b7
Changes
1
Hide whitespace changes
Inline
Side-by-side
app/src/main/java/PIS_HU1/Draw.java
View file @
e21738ab
package
PIS_HU1
;
import
processing.core.PApplet
;
import
java.util.Arrays
;
public
class
Draw
extends
PApplet
{
...
...
@@ -77,6 +79,7 @@ public class Draw extends PApplet {
}
if
(
key
==
'1'
){
game
.
makeMove
(
0
);
}
if
(
key
==
'2'
){
game
.
makeMove
(
1
);
...
...
@@ -102,8 +105,26 @@ public class Draw extends PApplet {
drawBoard
();
}
if
(
key
==
'u'
){
game
.
undoMove
();
game
.
undoMove
();
}
if
(
key
==
't'
){
GameEngine
test
=
new
GameEngine
();
test
.
playerBoard
=
Arrays
.
copyOf
(
game
.
playerBoard
,
game
.
playerBoard
.
length
);
test
.
move
=
Arrays
.
copyOf
(
game
.
move
,
game
.
move
.
length
);
test
.
heightCol
=
Arrays
.
copyOf
(
game
.
heightCol
,
game
.
heightCol
.
length
);
test
.
count
=
game
.
count
;
game
.
makeMove
(
test
.
chooseBestMove
(
test
,
100
));
}
if
(
key
==
't'
){
GameEngine
test
=
new
GameEngine
();
test
.
playerBoard
=
Arrays
.
copyOf
(
game
.
playerBoard
,
game
.
playerBoard
.
length
);
test
.
move
=
Arrays
.
copyOf
(
game
.
move
,
game
.
move
.
length
);
test
.
heightCol
=
Arrays
.
copyOf
(
game
.
heightCol
,
game
.
heightCol
.
length
);
test
.
count
=
game
.
count
;
game
.
makeMove
(
test
.
chooseBestMove
(
test
,
100
));
}
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment