James Gray
12/9/2005 6:44:00 PM
On Dec 9, 2005, at 12:26 PM, Adam Shelly wrote:
> Unless I'm really misreading the rules, there's a bug in the
> KalahGame class:
>
>
>> def play_game( bottom, top )
>> reset
> ## Play the game here...
>> [top_score, bottom_score]
>> end
>
> It's returning the scores in the reverse order of the players..
> So in KalahMatch, it reports the wrong winnner:
>> puts '========== GAME 1 =========='
>> p1_score_1, p2_score_1 =
>> KalahGame.new.play_game( p1, p2 )
>
> I think the last line of KalahGame#play_game should be:
> [bottom_score, top_score]
I agree. That looks like a bug.
Thanks for pointing it out.
James Edward Gray II
P.S. If anyone enhances the game engine and wants to share the
changes, I don't consider that a spoiler...