<html>
<body>
<div style="font-family: Verdana, Arial, Helvetica, Sans-Serif;">
<table bgcolor="#f9f3c9" width="100%" cellpadding="8" style="border: 1px #c9c399 solid;">
<tr>
<td>
This is an automatically generated e-mail. To reply, visit:
<a href="http://git.reviewboard.kde.org/r/109880/">http://git.reviewboard.kde.org/r/109880/</a>
</td>
</tr>
</table>
<br />
<blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: 10px;">
<p style="margin-top: 0;">On April 9th, 2013, 10:38 p.m. UTC, <b>Albert Astals Cid</b> wrote:</p>
<blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: 10px;">
<table width="100%" border="0" bgcolor="white" style="border: 1px solid #C0C0C0; border-collapse: collapse; margin: 2px padding: 2px;">
<thead>
<tr>
<th colspan="4" bgcolor="#F0F0F0" style="border-bottom: 1px solid #C0C0C0; font-size: 9pt; padding: 4px 8px; text-align: left;">
<a href="http://git.reviewboard.kde.org/r/109880/diff/4/?file=131939#file131939line157" style="color: black; font-weight: bold; text-decoration: underline;">src/abstractgrid.cpp</a>
<span style="font-weight: normal;">
(Diff revision 4)
</span>
</th>
</tr>
</thead>
<tbody style="background-color: #e4d9cb; padding: 4px 8px; text-align: center;">
<tr>
<td colspan="4"><pre style="font-size: 8pt; line-height: 140%; margin: 0; ">void AbstractGrid::initializeGrid(uint width, uint height, Wrapping wrapping)</pre></td>
</tr>
</tbody>
<tbody>
<tr>
<th bgcolor="#f0f0f0" style="border-right: 1px solid #C0C0C0;" align="right"><font size="2">157</font></th>
<td bgcolor="#ffffff" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "> <span class="c1">// shuffle all cells</span></pre></td>
<th bgcolor="#f0f0f0" style="border-left: 1px solid #C0C0C0; border-right: 1px solid #C0C0C0;" align="right"><font size="2">157</font></th>
<td bgcolor="#ffffff" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "> <span class="c1">// shuffle all cells</span></pre></td>
</tr>
</tbody>
</table>
<pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">We are actually not shuffling all the cells anymore, are we? Can you explain where the cellCount *8 / 10 comes from?</pre>
</blockquote>
<p>On April 10th, 2013, 3:34 a.m. UTC, <b>Ashwin Rajeev</b> wrote:</p>
<blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: 10px;">
<pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">const int MinimumNumCells = cellCount() * 8 / 10; // minimum number of non-empty cells in a difficulty level. This is used while generating board.
There is no particular reason for choosing the same a shuffleLimit.</pre>
</blockquote>
</blockquote>
<pre style="margin-left: 1em; white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">I now remember why i choose shuffleLimit same as MinimumNumCells. Even at worst case ( rand() % 3 + 1 never produced 2 and number of filled cells = MinimumNumCells ) this algorithm will work fine. For a higher shuffleLimit !cellsNotSuffled.isEmpty() is needed along with m_minimumMoves < shuffleLimit to ensure correctness of that loop. But then minimum moves will have a value in the range MinimumNumCells and shuffleLimit.</pre>
<br />
<p>- Ashwin</p>
<br />
<p>On April 10th, 2013, 2:29 p.m. UTC, Ashwin Rajeev wrote:</p>
<table bgcolor="#fefadf" width="100%" cellspacing="0" cellpadding="8" style="background-image: url('http://git.reviewboard.kde.org/static/rb/images/review_request_box_top_bg.ab6f3b1072c9.png'); background-position: left top; background-repeat: repeat-x; border: 1px black solid;">
<tr>
<td>
<div>Review request for KDE Games, Albert Astals Cid and Parker Coates.</div>
<div>By Ashwin Rajeev.</div>
<p style="color: grey;"><i>Updated April 10, 2013, 2:29 p.m.</i></p>
<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Description </h1>
<table width="100%" bgcolor="#ffffff" cellspacing="0" cellpadding="10" style="border: 1px solid #b8b5a0">
<tr>
<td>
<pre style="margin: 0; padding: 0; white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">Instead of randomly rotating every cell, rotate random cells such that initial and final state are not same and minimum moves to win is equal to shuffle limit.
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.</pre>
</td>
</tr>
</table>
<div style="margin-top: 1.5em;">
<b style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Bugs: </b>
<a href="http://bugs.kde.org/show_bug.cgi?id=160470">160470</a>
</div>
<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Diffs</b> </h1>
<ul style="margin-left: 3em; padding-left: 0;">
<li>src/abstractgrid.cpp <span style="color: grey">(63ed8b8)</span></li>
<li>src/globals.h <span style="color: grey">(6df25a0)</span></li>
</ul>
<p><a href="http://git.reviewboard.kde.org/r/109880/diff/" style="margin-left: 3em;">View Diff</a></p>
</td>
</tr>
</table>
</div>
</body>
</html>