[Kde-games-devel] Review Request 111705: Testcode for hard AI for KSquares

Tom Vincent Peters kde at vincent-peters.de
Sun Oct 20 19:48:16 UTC 2013



> On Oct. 19, 2013, 6:05 p.m., Albert Astals Cid wrote:
> > 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,".

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.


> On Oct. 19, 2013, 6:05 p.m., Albert Astals Cid wrote:
> > src/ksquaresdemowindow.cpp, line 100
> > <http://git.reviewboard.kde.org/r/111705/diff/3/?file=202316#file202316line100>
> >
> >     Why this change?

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.


> On Oct. 19, 2013, 6:05 p.m., Albert Astals Cid wrote:
> > src/ksquaresgame.cpp, line 32
> > <http://git.reviewboard.kde.org/r/111705/diff/3/?file=202317#file202317line32>
> >
> >     Why all those kdebugs commented?

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.


- Tom Vincent


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
http://git.reviewboard.kde.org/r/111705/#review41986
-----------------------------------------------------------


On Oct. 17, 2013, 11:22 a.m., Tom Vincent Peters wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> http://git.reviewboard.kde.org/r/111705/
> -----------------------------------------------------------
> 
> (Updated Oct. 17, 2013, 11:22 a.m.)
> 
> 
> Review request for KDE Games and Matt Williams.
> 
> 
> Repository: ksquares
> 
> 
> Description
> -------
> 
> 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
> 
> 
> Diffs
> -----
> 
>   src/aicontroller.h bc2a9d7 
>   src/aicontroller.cpp 7ff3d22 
>   src/gameboardscene.cpp 0fa669a 
>   src/ksquaresdemowindow.h 3f3d421 
>   src/ksquaresdemowindow.cpp eea7e5a 
>   src/ksquaresgame.cpp 74a06d3 
>   src/ksquareswindow.cpp a71a2ea 
> 
> Diff: http://git.reviewboard.kde.org/r/111705/diff/
> 
> 
> Testing
> -------
> 
> 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
> 
> 
> Thanks,
> 
> Tom Vincent Peters
> 
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-games-devel/attachments/20131020/d1547df7/attachment.html>


More information about the kde-games-devel mailing list