mirror of
https://github.com/Noratrieb/minmax.git
synced 2026-01-14 15:25:08 +01:00
rust beats java lol
This commit is contained in:
parent
c235e4ec65
commit
9c749f1ae9
2 changed files with 3 additions and 2 deletions
|
|
@ -17,7 +17,7 @@ public class Connect4ArenaMain {
|
||||||
static final int NOMOVE = -1;
|
static final int NOMOVE = -1;
|
||||||
|
|
||||||
public static void main(String[] args) {
|
public static void main(String[] args) {
|
||||||
new Connect4ArenaMain().play(new HumanPlayer(), new PerfectPlayer());
|
new Connect4ArenaMain().play(new RustPlayer(), new PerfectPlayer());
|
||||||
}
|
}
|
||||||
|
|
||||||
static String toDebugString(Stone[] board) {
|
static String toDebugString(Stone[] board) {
|
||||||
|
|
|
||||||
|
|
@ -70,7 +70,8 @@ public class PerfectPlayer extends Connect4ArenaMain.DefaultPlayer {
|
||||||
@Override
|
@Override
|
||||||
protected int play() {
|
protected int play() {
|
||||||
bestMove = -1;
|
bestMove = -1;
|
||||||
minmax(myColor, LOST, WON, 0);
|
// LOST -1 so that at least one move is better and gets selected even when everything is lost
|
||||||
|
minmax(myColor, LOST - 1, WON, 0);
|
||||||
return this.bestMove;
|
return this.bestMove;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue