Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
C
COMP1206-Mathdoku
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Nimrod Abramovich
COMP1206-Mathdoku
Commits
71a92a62
Commit
71a92a62
authored
5 years ago
by
Nimrod Abramovich
Browse files
Options
Downloads
Patches
Plain Diff
Added file reading to load file button
parent
39ce81d8
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
bin/coursework/Main.class
+0
-0
0 additions, 0 deletions
bin/coursework/Main.class
mathdokuCage.txt
+15
-0
15 additions, 0 deletions
mathdokuCage.txt
src/coursework/Main.java
+20
-4
20 additions, 4 deletions
src/coursework/Main.java
with
35 additions
and
4 deletions
bin/coursework/Main.class
+
0
−
0
View file @
71a92a62
No preview for this file type
This diff is collapsed.
Click to expand it.
mathdokuCage.txt
0 → 100644
+
15
−
0
View file @
71a92a62
11+ 1,7
2÷ 2,3
20x 4,10
6x 5,6,12,18
3- 8,9
3÷ 11,17
240x 13,14,19,20
6x 15,16
6x 21,27
7+ 22,28,29
30x 23,24
6x 25,26
9+ 30,36
8+ 31,32,33
2÷ 34,35
\ No newline at end of file
This diff is collapsed.
Click to expand it.
src/coursework/Main.java
+
20
−
4
View file @
71a92a62
package
coursework
;
import
java.io.BufferedReader
;
import
java.io.FileNotFoundException
;
import
java.io.FileReader
;
import
java.io.IOException
;
import
javafx.application.*
;
import
javafx.event.EventHandler
;
import
javafx.geometry.Insets
;
...
...
@@ -132,8 +137,19 @@ public class Main extends Application {
topHBox
.
getChildren
().
addAll
(
loadGameFileButton
,
showMistakesButton
,
loadGameTextInputButton
);
final
String
PATH
=
"C:\\Java Eclipse Workspace\\Programming II Coursework\\mathdokuCage.txt"
;
loadGameFileButton
.
setOnAction
(
e
->
{
try
{
BufferedReader
file
=
new
BufferedReader
(
new
FileReader
(
PATH
));
String
line
;
while
((
line
=
file
.
readLine
())
!=
null
)
{
System
.
out
.
println
(
line
);
}
}
catch
(
FileNotFoundException
e1
)
{
e1
.
printStackTrace
();
}
catch
(
IOException
e2
)
{
e2
.
printStackTrace
();
}
});
return
topHBox
;
...
...
@@ -193,11 +209,11 @@ public class Main extends Application {
private
void
setupCages
()
{
new
Cage
(
new
int
[]
{
0
,
6
},
11
,
"+"
);
new
Cage
(
new
int
[]
{
1
,
2
},
2
,
"
/
"
);
new
Cage
(
new
int
[]
{
1
,
2
},
2
,
""
);
new
Cage
(
new
int
[]
{
3
,
9
},
20
,
"x"
);
new
Cage
(
new
int
[]
{
7
,
8
},
3
,
"-"
);
new
Cage
(
new
int
[]
{
4
,
5
,
11
,
17
},
6
,
"x"
);
new
Cage
(
new
int
[]
{
10
,
16
},
3
,
"
/
"
);
new
Cage
(
new
int
[]
{
10
,
16
},
3
,
""
);
new
Cage
(
new
int
[]
{
12
,
13
,
18
,
19
},
240
,
"x"
);
new
Cage
(
new
int
[]
{
14
,
15
},
6
,
"x"
);
new
Cage
(
new
int
[]
{
24
,
25
},
6
,
"x"
);
...
...
@@ -205,7 +221,7 @@ public class Main extends Application {
new
Cage
(
new
int
[]
{
21
,
27
,
28
},
7
,
"+"
);
new
Cage
(
new
int
[]
{
22
,
23
},
30
,
"x"
);
new
Cage
(
new
int
[]
{
30
,
31
,
32
},
8
,
"+"
);
new
Cage
(
new
int
[]
{
33
,
34
},
2
,
"
/
"
);
new
Cage
(
new
int
[]
{
33
,
34
},
2
,
""
);
new
Cage
(
new
int
[]
{
29
,
35
},
9
,
"+"
);
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment