[Kde-games-devel] Review Request 109880: New shuffling algorithm
Ashwin Rajeev
ashwin_rajeev at hotmail.com
Tue Apr 9 13:30:12 UTC 2013
> On April 6, 2013, 10:11 p.m., Albert Astals Cid wrote:
> > Can you please explain (as comment in the code) what the new algorithm does? The old one was pretty simple, go thorugh all the cells and rotate them. But i tried understanding the new one you made and it's not that easy, so a comment would certainly help whoever comes in 2 years and tries to see what it is doing
>
> Ashwin Rajeev wrote:
> To reduce the complexity i am thinking of dropping this case "if (m_minimumMoves == shufflelimit - 1)" . What is your opinion ?
> Then for each level minimumMoves to win will be shufflelimit or shufflelimit + 1 instead of just shufflelimit.
>
> Albert Astals Cid wrote:
> Don't know, as said i tried to understand what you're trying to do and failed. Specially shuffledCells and the rand() moduled over the decrementing i makes my brain get lost :D That's why i asked you to do a full comment of what the algorithm does.
Instead of randomly rotating every cell, this algorithm rotate random cells.
- Ashwin
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
http://git.reviewboard.kde.org/r/109880/#review30586
-----------------------------------------------------------
On April 7, 2013, 2:53 p.m., Ashwin Rajeev wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> http://git.reviewboard.kde.org/r/109880/
> -----------------------------------------------------------
>
> (Updated April 7, 2013, 2:53 p.m.)
>
>
> Review request for KDE Games, Albert Astals Cid and Parker Coates.
>
>
> Description
> -------
>
> While minimum moves to win is less than or equal to minimum number of cells in that particular difficulty level shuffle a random cell that is not yet shuffled.
>
> This will also make sure the highscore is impartial on every game.
> I am also thinking of committing new highscore method since this patch will make getting highscore impossible for some cases.
>
>
> This addresses bug 160470.
> http://bugs.kde.org/show_bug.cgi?id=160470
>
>
> Diffs
> -----
>
> src/abstractgrid.cpp 63ed8b8
>
> Diff: http://git.reviewboard.kde.org/r/109880/diff/
>
>
> Testing
> -------
>
>
> Thanks,
>
> Ashwin Rajeev
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-games-devel/attachments/20130409/bf2a56e6/attachment.html>
More information about the kde-games-devel
mailing list