Yes, my thoughts - since I'm not as technical as the rest of you:

BowlingGame class
"runs the game a calls each frame to 'process'"
- frames (1-10 aFrame objects)
- score (aScore object)
- currentFrame

Frame class
"frame handles #throws, pins remaining, and lets Game know when to advance to next frame - frameEnd"
- frame#
- throws (1-3 aThrow objects - aFrame controls 10th frame 3rd throw)
- score (numeric)

Throw class
- frame (the frame I belong to)
- throw# (incremental numeric 1-3)
- pinsKnockedDown (0-10)

Score class
- frames (same as BowlingGame class)
- methods to calculate score, once a frame score has been determined, it is stored on the frame and the score calc simply picks that up and moves forward on each successive score calc (after each throw - called from inside of aFrame)

This will be a fun little diversion.�� I'll create a simple UI and engine that will randomly return a number of pinsKnockedDown when pressing the spacebar to roll the next ball.

On Fri, Sep 25, 2020 at 3:11 PM DavidBajger <bajger@gmail.com> wrote:
Thanks for your reply! Anyway.. wow, 3 lines of code, I'd like to see that! I
didn't really get into FLP (except some small howeworks on University and
that's alraeady forgotten), so I don't know, what is the advantage here. I
thought that Pharo (Smalltalk) can be considered as functional language too,
because of blocks. If there wouldn't be any exception handling, would Pharo
code be so compact as well (e.g. by using #inject:into:)?





-----
David Bajger
--
Sent from: http://forum.world.st/Pharo-Smalltalk-Users-f1310670.html


--
Russ Whaley
whaley.russ@gmail.com