<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/111705/">http://git.reviewboard.kde.org/r/111705/</a>
</td>
</tr>
</table>
<br />
<blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: 10px;">
<p style="margin-top: 0;">On October 19th, 2013, 6:05 p.m. UTC, <b>Albert Astals Cid</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;">Is this something that you plan running manually? Or is this something we can try to make run on
make test
so it tests one AI is better than the other?
Because a manual test is good for now but people will forget to run it, so something automatic is a good idea, but then you're missing how to tie it to the buildsystem, etc. You can check in killbots that has some autotests (not for the AI, but the buildsystem bits should be similar).
That is if you want to commit this, since you still have the "This is not supposed to be comitted,".</pre>
</blockquote>
</blockquote>
<pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">The code was intended as a manual test. Nevertheless I could use it as a basis to create an AI-autotest. The code as it is now is in no condition to be comitted because it abuses the demo mode and is just a dirty hack. I'll look into killbots and come up with something more useable, ideally without any GUI.
By the way: I have the intention to add some features to ksquares (undo & redo, load & save, solve the "cheat" problem I mentioned about a year ago) as preparation for a more advanced AI.</pre>
<br />
<blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: 10px;">
<p style="margin-top: 0;">On October 19th, 2013, 6:05 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/111705/diff/3/?file=202316#file202316line100" style="color: black; font-weight: bold; text-decoration: underline;">src/ksquaresdemowindow.cpp</a>
<span style="font-weight: normal;">
(Diff revision 3)
</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 KSquaresDemoWindow::gameNew()</pre></td>
</tr>
</tbody>
<tbody>
<tr>
<th bgcolor="#e9eaa8" style="border-right: 1px solid #C0C0C0;" align="right"><font size="2">95</font></th>
<td bgcolor="#fdfebc" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "><span class="tb"> </span><span class="n">QTimer</span><span class="o">::</span><span class="n">singleShot</span><span class="p">(</span><span class="mi"><span class="hl">200</span></span><span class="p">,</span> <span class="k">this</span><span class="p">,</span> <span class="n">SLOT</span><span class="p">(</span><span class="n">aiChooseLine</span><span class="p">()));</span></pre></td>
<th bgcolor="#e9eaa8" style="border-left: 1px solid #C0C0C0; border-right: 1px solid #C0C0C0;" align="right"><font size="2">100</font></th>
<td bgcolor="#fdfebc" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "><span class="tb"> </span><span class="n">QTimer</span><span class="o">::</span><span class="n">singleShot</span><span class="p">(</span><span class="mi"><span class="hl">1</span></span><span class="p">,</span> <span class="k">this</span><span class="p">,</span> <span class="n">SLOT</span><span class="p">(</span><span class="n">aiChooseLine</span><span class="p">()));</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;">Why this change?</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;">This was made to speed up the games. It still takes about 4 minutes until the 400 test games are done; without that change it would take ages.</pre>
<br />
<blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: 10px;">
<p style="margin-top: 0;">On October 19th, 2013, 6:05 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/111705/diff/3/?file=202317#file202317line32" style="color: black; font-weight: bold; text-decoration: underline;">src/ksquaresgame.cpp</a>
<span style="font-weight: normal;">
(Diff revision 3)
</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; ">KSquaresGame::~KSquaresGame()</pre></td>
</tr>
</tbody>
<tbody>
<tr>
<th bgcolor="#e9eaa8" style="border-right: 1px solid #C0C0C0;" align="right"><font size="2">32</font></th>
<td bgcolor="#fdfebc" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "><span class="tb"> </span><span class="n">kDebug</span><span class="p">()</span> <span class="o"><<</span> <span class="s">"Creating Game with"</span> <span class="o"><<</span> <span class="n">startPlayers</span><span class="p">.</span><span class="n">size</span><span class="p">()</span> <span class="o"><<</span> <span class="s">"player(s)"</span><span class="p">;</span></pre></td>
<th bgcolor="#e9eaa8" style="border-left: 1px solid #C0C0C0; border-right: 1px solid #C0C0C0;" align="right"><font size="2">32</font></th>
<td bgcolor="#fdfebc" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "><span class="hl"><span class="tb"> </span></span><span class="c1"><span class="hl">//</span>kDebug() << "Creating Game with" << startPlayers.size() << "player(s)";</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;">Why all those kdebugs commented?</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;">The comments stop kDebug from cluttering the statistical output that can be seen in "testing done". That way you get clean statistical information in the command line.</pre>
<br />
<p>- Tom Vincent</p>
<br />
<p>On October 17th, 2013, 11:22 a.m. UTC, Tom Vincent Peters 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 and Matt Williams.</div>
<div>By Tom Vincent Peters.</div>
<p style="color: grey;"><i>Updated Oct. 17, 2013, 11:22 a.m.</i></p>
<div style="margin-top: 1.5em;">
<b style="color: #575012; font-size: 10pt;">Repository: </b>
ksquares
</div>
<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;">This is meant to test the strength of AI-levels in KSquares.
Hard AI code: https://git.reviewboard.kde.org/r/111662/
This is not supposed to be comitted, it's just for testing purposes.
Use by calling KSquares from command line in demo mode 'ksquares --demo'. It will run 400 games and print out statistics.
Changes:
- changed demo mode to two player mode
- speed up of demo mode
- most debug messages commented out
- overall game score for statistics</pre>
</td>
</tr>
</table>
<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Testing </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;">ksquares(5704) KSquaresGame::KSquaresGame: Constructing Game
ksquares(5704) KSquaresDemoWindow::gameOver: Easy : Medium score: 0 : 100
ksquares(5704) KSquaresDemoWindow::gameOver: Medium : Easy score: 100 : 0
ksquares(5704) KSquaresDemoWindow::gameOver: Hard : Medium score: 100 : 0
ksquares(5704) KSquaresDemoWindow::gameOver: Medium : Hard score: 0 : 100
ksquares(5704): Test finished
ksquares(6483) KSquaresGame::KSquaresGame: Constructing Game
ksquares(6483) KSquaresDemoWindow::gameOver: Easy : Medium score: 0 : 100
ksquares(6483) KSquaresDemoWindow::gameOver: Medium : Easy score: 96 : 4
ksquares(6483) KSquaresDemoWindow::gameOver: Hard : Medium score: 100 : 0
ksquares(6483) KSquaresDemoWindow::gameOver: Medium : Hard score: 0 : 100
ksquares(6483): Test finished</pre>
</td>
</tr>
</table>
<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Diffs</b> </h1>
<ul style="margin-left: 3em; padding-left: 0;">
<li>src/aicontroller.h <span style="color: grey">(bc2a9d7)</span></li>
<li>src/aicontroller.cpp <span style="color: grey">(7ff3d22)</span></li>
<li>src/gameboardscene.cpp <span style="color: grey">(0fa669a)</span></li>
<li>src/ksquaresdemowindow.h <span style="color: grey">(3f3d421)</span></li>
<li>src/ksquaresdemowindow.cpp <span style="color: grey">(eea7e5a)</span></li>
<li>src/ksquaresgame.cpp <span style="color: grey">(74a06d3)</span></li>
<li>src/ksquareswindow.cpp <span style="color: grey">(a71a2ea)</span></li>
</ul>
<p><a href="http://git.reviewboard.kde.org/r/111705/diff/" style="margin-left: 3em;">View Diff</a></p>
</td>
</tr>
</table>
</div>
</body>
</html>