The first programming task is (in spring 2013) belonging to the profession Artificial intelligence is about the game of chess. The idea is to write a simple program that a small part of this game as good as possible plays. We look only to the situation where a white lady (WQ) and white king (WK) try to set mat a lone black king (BK).
Use the C++ sample program from the website.
Make three Al-players for white:
One :plays completely random, see code
Two: think yourself a (simple )strategy. Fill in the code with a suitable function.
One possible idea is the following. The lady is now often beaten: avoid that.
Three : idem. But with a different strategy.
One idea is ,for example , the following . Walk all the possibilities , play a possibility in a copy of the board on the turn(through Board copy = *this;), assess the move, and select the “best” move. Do not think further ahead.
What is the size of the rectangle in which the black king can move? How many possible moves does the black king have ? Is the black king on the edge? How near are the white pieces together? How near are the white and black pieces together?
Try this to program as simple as possible. There are simple systems to put mat the king. but the purpose of this exercises is to own heuristics to devise and to write a report, give the report also other approaches ,for example the endgame-database with references.
So let the three players play, and report the findings( averages, standard deviations, charts). The black player always plays random.
In short: make various simulations; to vary include the size of the board. There may freely with-source-make use of the sample code.
There is not asked for a program that meets all the software engineering standards. Keep the program so simple - but neat!
You can find the original website here:
and the source code is here : we will fill in this code with good working functions;
Please make an original code because teacher is not easy person!! ;)
I hope you understand it, if not?, than you can always ask me questions.