GREEN: save score state and add knocked pins on each roll
This commit is contained in:
parent
e4167c03a5
commit
b4cdd039ae
1 changed files with 6 additions and 2 deletions
|
|
@ -1,7 +1,11 @@
|
||||||
class BowlingGame {
|
class BowlingGame {
|
||||||
void roll(int pins) {}
|
int _score = 0;
|
||||||
|
|
||||||
|
void roll(int pins) {
|
||||||
|
_score += pins;
|
||||||
|
}
|
||||||
|
|
||||||
int score() {
|
int score() {
|
||||||
return 0;
|
return _score;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue