Skip to content

Commit f267d4d

Browse files
committed
added mainloop method
1 parent de389a0 commit f267d4d

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

ch15/Automaton.java

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,15 @@ public void run(String title, int rate) {
2929
frame.add(this.grid);
3030
frame.pack();
3131
frame.setVisible(true);
32+
this.mainloop(rate);
33+
}
3234

33-
// main simulation loop
35+
/**
36+
* The simulation loop.
37+
*
38+
* @param rate frames per second
39+
*/
40+
private void mainloop(int rate) {
3441
while (true) {
3542

3643
// update the drawing

0 commit comments

Comments
 (0)