>>On Monday, December 27, 2004, at 8:00:14 AM, Roberto Lupi wrote:
>>
>>>I can write a stream-based implementation using #peek ...
>>>I would have to add my own and I don't think that
>>>it's worth the effort.
>>
>>Yes. You need to peek two into the future, and I haven't seen such a
>>method either. It would be rather a nifty implementation, though:
> 
> 
> Hi, Roberto,
> 
> I tried for the Stream implementation for exactly those reasons, and 
> gave up for exactly those reasons. I found 'peek' but couldn't find 
> a 'peekAt:' thing.
> 
> Ron suggested using a Stack at one point, so one could go Pop, Peek, 
> Push .... but at this point I felt we had left the bowling domain by 
> too far.  
> 
> I'll be happy to see if anyone can get rid of th +1 and +2. It weirds 
> me out, too.

It should not be so hard. Just go from bottom to top, calculate scores 
as You go, and store last couple of rolls for later using...

For implementation You would probably need to write the rolls to the 
stream in reverse order..

How usable this approach is, I do not know.

-- 
Gert


[Non-text portions of this message have been removed]



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/
 



Reply via email to