On Monday, December 27, 2004, at 8:00:14 AM, Roberto Lupi wrote:

> I see. Thanks for the clarification: I have never played bowling
> myself and I didn't know this rule. I was working back from your code.

Yes. Feel free to borrow the tests if you want to play further. Or
even the code.

I'm on a path to post the code somewhere, but that won't happen for
a while yet.

> I can write a stream-based implementation using #peek instead of
> #next, but I don't think if I should. My Smalltalk environment
> (Dolphin) lacks a method that returns multiple future values from a
> PositionableStream. 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:

  self isStrike
    ifTrue: [^stream first + stream peekFirst + stream peekSecond]

with isStrike:

  isStrike
    ^stream peekFirst = 10

I think I like it! I'm gonna try that approach. Cool idea.

Ron Jeffries
www.XProgramming.com
I could be wrong, but I'm not.  --Eagles, Victim of Love




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