Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
LI Qi
Bowling
Commits
062e0778
Commit
062e0778
authored
Feb 06, 2016
by
Qi LI
Browse files
read score table information
parent
49255c07
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/game/ScoreTable.java
View file @
062e0778
...
...
@@ -22,6 +22,18 @@ public class ScoreTable {
else
return
frames
.
get
(
frames
.
size
()
-
1
);
}
public
String
readTable
()
{
StringBuffer
pins
=
new
StringBuffer
();
StringBuffer
scores
=
new
StringBuffer
();
for
(
int
i
=
0
;
i
<
frames
.
size
();
++
i
)
{
Frame
frame
=
frames
.
get
(
i
);
pins
.
append
(
String
.
format
(
"|%5d %2d"
,
frame
.
getFirstLance
(),
frame
.
isStrike
()
||
!
frame
.
isFinished
()
?
0
:
frame
.
getSecondLance
()));
scores
.
append
(
String
.
format
(
"|%3d "
,
frame
.
getScore
()));
}
return
pins
.
toString
()
+
"\n"
+
scores
.
toString
();
}
public
boolean
isComplete
()
{
int
framesNumber
=
frames
.
size
();
if
(
framesNumber
<
10
)
return
false
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment