Posted by
DavidBajger on
Sep 24, 2020; 11:42am
URL: https://forum.world.st/exercism-bowling-challenge-tp5122317p5122396.html
Hi Roelof,
I always wonder, what kind of answer you expect from your prior statement.
To your question: "Can this plan be working or is there improvements to this
plan." I can have this answer: Yes, it could be both: working or fail, but
you don't know before you try.
This exercise is a bit tricky:
1) I can recommend to use also LastFrame class, which has specific handling
of bonuses in last round of game (subclass of Frame). Bowling game can be
then initialized with array 9 Frame instances and last instance could be
LastFrame. I used specific test methods on frame classes like:
#isFrameComplete, #isLastFrame, #isSpare, #isStrike, #isOpen.
2) Beware that Bowling game should know only necessary things and delegate
responsibility to its frames. Game itself knows that only if all frames are
completed, game ends.
3) Total score is sum of all throws+bonuses of individual frames, etc.
Does it help to start with exercise?
David
-----
David Bajger
--
Sent from:
http://forum.world.st/Pharo-Smalltalk-Users-f1310670.html
David Bajger