From: "Tony Nassar" <[EMAIL PROTECTED]> To: "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> Sent: Sunday, December 26, 2004 4:02 PM Subject: RE: [XP] New Article - BowlingForSmalltalkV - a small procedural example
> > The XP Washington DC group took up the deathless Bowling Game task at its > CodeFests, fwiw. After I spent a session getting nothing done (I was > trying endless to model the Platonic essence of the Frame class, before I > could get to the Game itself), I sat down at home and wrote a procedural > solution pretty much like Jeff's. If all you want to do is produce the > correct final score, well, the requirement is satisfied. > > I haven't figured out how to go beyond that, not because I ain't gonna > need it, but because I can't figure out what I *do* need. I've considered > letting the requirements be driven by an imaginary or mock scoring > display, to which I feed each roll in turn, along with incremental scored. > I mean, when I'm *at* the bowling alley, I need incremental scores, right? > Has anyone watched any bowling on TV recently, just to get another > perspective on potential requirements? I don't find it exciting to watch, > really, but it's part of the job here. Well, I did it that way because I didn't get that the original requirement was that the program would be handed a correct array of all the rolls, and all that needed to be done was produce the final total. It's not all that hard to let the code tell you what it wants to be if you start out with tests that call a "roll" method, and only deliver a few balls to that method before checking the score. Once you've got a variety of tests working with partial and complete games, it's relatively easy to add the bells and whistles; in particular the individual frame cumulative scores and the strike and spare indicators. The key is to add the features one at a time. > > Another thing I might need is a BowlingGame implementation that would > maintain more than one incremental score, since I prefer not to bowl alone > (cf. > http://www.amazon.com/exec/obidos/tg/detail/-/0743203046/qid=1104098361/sr=8-1/ref=pd_csp_1/104-6459054-7819934?v=glance&s=books&n=507846), > > nor do the rules allow me to bowl all ten frames before my opponents bowl > any! I'd think that once you've got an implementation with a container and an array of frames, doing multiple games at the same time would be easy. My bowling time was long before the automatic scoring machines, but the few times I've seen them, I seem to remember buttons to say which bowler was up. John Roth > To Post a message, send it to: [EMAIL PROTECTED] To Unsubscribe, send a blank message to: [EMAIL PROTECTED] ad-free courtesy of objectmentor.com Yahoo! Groups Links <*> To visit your group on the web, go to: http://groups.yahoo.com/group/extremeprogramming/ <*> To unsubscribe from this group, send an email to: [EMAIL PROTECTED] <*> Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/
