[Kde-games-devel] [PATCH] Change to KNetwalk move counting

Parker Coates parker.coates at gmail.com
Sun Oct 26 20:39:35 CET 2008


On Fri, Oct 24, 2008 at 10:52, Fela Winkelmolen <nimatar at gmail.com> wrote:
>> Hello all,
>>
>> The attached patch is a rather simple change to KNetwalk to change how
>> it counts "moves". It implements the behaviour requested in bug
>> 167592. [1]
>
> It looks good, I couldn't test it as I have some problems with the KDE cmake
> files (after updating to kubuntu intrepid). But if you commit it I'll test it
> as soon as I can. I also tend to agree with your points below. I'm not sure if
> the new way of counting moves is more intuitive to a new user, but it may be.

Since it's more than just a bugfix, I'd rather not commit until you've
had a chance to try it out.

Not surprisingly, I seem to have jinxed myself my saying "the patch is
only 8 lines and changes only a couple integers, so it's unlikely to
cause too many surprises." I just found an issue with the score
calculation. Under the current system, you could only ever be over by
an even number of clicks, so the extra clicks were (integer) divided
by two before calculating the move penalty. That no longer makes sense
after the patch, so one extra move was being rounded down to zero by
the integer division.

The attached patch fixes that by removing the division by 2, but I
don't really understand how the score calculation is supposed to work,
so it might not be perfect. I guess I'll take this opportunity to
mention bug 172089 [1] which proposes redoing the score calculation.
If this change goes in, it probably would make sense to do them at the
same time.

Parker

PS: I just noticed that the patch breaks whitespace on empty lines,
but you get the idea.

[1] https://bugs.kde.org/show_bug.cgi?id=172089
-------------- next part --------------
A non-text attachment was scrubbed...
Name: knetwalk.diff
Type: text/x-diff
Size: 1698 bytes
Desc: not available
Url : http://mail.kde.org/pipermail/kde-games-devel/attachments/20081026/63b2549f/attachment.bin 


More information about the kde-games-devel mailing list