Commit 062e0778 authored by Qi LI's avatar Qi LI
Browse files

read score table information

parent 49255c07
......@@ -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;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment