Skip to content

Commit d388f13

Browse files
author
Peter
committed
fixing the endless loop + burn 100% problem
1 parent 238f319 commit d388f13

File tree

5 files changed

+14
-4
lines changed

5 files changed

+14
-4
lines changed

.gitignore

+2-1
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1-
tmp/
1+
tmp/
2+
build/

.gitignore~

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
tmp/

nbproject/project.properties

+1-1
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ javadoc.splitindex=true
5555
javadoc.use=true
5656
javadoc.version=false
5757
javadoc.windowtitle=
58-
main.class=
58+
main.class=EbbeFlut
5959
manifest.file=manifest.mf
6060
meta.inf.dir=${src.dir}/META-INF
6161
mkdist.disabled=false

src/GraphicBoard.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@ public void labelSet(String str, int x, int y,Color color)
213213

214214
static public void setGraphics(Button b,Color c,String str)
215215
{ b.setFont(new Font("Dialog",Font.BOLD,22));
216-
b.setForeground(c);
216+
b.setForeground(c);
217217
b.setLabel(str);
218218
}
219219

src/HumanPlayer.java

+9-1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313
*/
1414

1515
import java.awt.Color;
16+
import java.util.logging.Level;
17+
import java.util.logging.Logger;
1618

1719
/** for humanplayer
1820
* @see Chronos for chronical-order-implementation
@@ -30,7 +32,13 @@ public HumanPlayer(Color color, String namePlayer,int no)
3032
public Path moves()
3133
{ EbbeFlut.chronical.newTurn(EbbeFlut.chronical.fromBeginning());
3234

33-
while(!EbbeFlut.chronical.isTurnFinished() && (!EbbeFlut.chronical.isGameFinished() || EbbeFlut.chronical.lastMoves()) );
35+
while(!EbbeFlut.chronical.isTurnFinished() && (!EbbeFlut.chronical.isGameFinished() || EbbeFlut.chronical.lastMoves()) ) {
36+
try {
37+
Thread.sleep(10);
38+
} catch (InterruptedException ex) {
39+
ex.printStackTrace();
40+
}
41+
}
3442

3543
return path;
3644
}

0 commit comments

Comments
 (0)