Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 06e6b72

Browse files
Chapter 08 section 02 completed.
1 parent 6be898b commit 06e6b72

File tree

4 files changed

+1
-30
lines changed

4 files changed

+1
-30
lines changed

‎08-Move-the-Box-Solver/02-Move-the-Box-Data/src/AlgoFrame.java

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,4 @@
1-
import java.awt.Graphics2D;
2-
import java.awt.Graphics;
3-
import java.awt.Dimension;
4-
import java.awt.Color;
5-
import java.awt.RenderingHints;
6-
1+
import java.awt.*;
72
import javax.swing.*;
83

94
public class AlgoFrame extends JFrame{

‎08-Move-the-Box-Solver/02-Move-the-Box-Data/src/AlgoVisualizer.java

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,14 @@
11
import java.awt.*;
2-
import java.awt.event.*;
32

43
public class AlgoVisualizer {
54

6-
private static int DELAY = 5;
7-
private static int blockSide = 80;
8-
95
private GameData data;
106
private AlgoFrame frame;
117

128
public AlgoVisualizer(String filename){
139

1410
data = new GameData(filename);
15-
int sceneWidth = data.M() * blockSide;
16-
int sceneHeight = data.N() * blockSide;
17-
18-
EventQueue.invokeLater(() -> {
19-
frame = new AlgoFrame("Move the Box Solver", sceneWidth,sceneHeight);
20-
21-
new Thread(() -> {
22-
run();
23-
}).start();
24-
});
25-
}
26-
27-
public void run(){
28-
29-
setData();
30-
}
3111

32-
private void setData(){
33-
frame.render(data);
34-
AlgoVisHelper.pause(DELAY);
3512
}
3613

3714
public static void main(String[] args) {

‎08-Move-the-Box-Solver/02-Move-the-Box-Data/src/GameData.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ public GameData(String filename){
2727
scanner = new Scanner(new BufferedInputStream(fis), "UTF-8");
2828

2929
String turnline = scanner.nextLine();
30-
3130
this.maxTurn = Integer.parseInt(turnline);
3231

3332
ArrayList<String> lines = new ArrayList<String>();

‎08-Move-the-Box-Solver/Chapter-08.key

4.99 MB
Binary file not shown.

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /