[gcompris-devel] chess position to complete
Bruno Coudoin
bruno.coudoin at free.fr
Sat Oct 25 08:14:27 UTC 2003
Absolutly no programming or really poor programming skill are required.
Just look at the file src/boards/chess_position.c.
For example:
pos->square [E1] = WK;
Means put a White King on E1. You need more chess experience than
programming.
in set_initial_movelearn() this set the complete position for the level
2.
-----
case 2:
/* The white pieces */
pos->square [E1] = WK;
pos->square [G1] = WQ;
/* The black pieces */
pos->square [A1] = BK;
pos->square [E7] = BP;
/* The kings */
pos->priv->wk_square = E1;
pos->priv->bk_square = A1;
break;
-----
So you also need to put the kings in another structure named
pos->priv->wk_square and pos->priv->bk_square for white king and black
king. Just point to the Coord of where you did put them.
In chess_makros.h you will find the definition of all the pieces:
#define WP - /* white pawn */
#define WN - /* white knight */
#define WB - /* white bishop */
#define WR - /* white rook */
#define WQ - /* white queen */
#define WK - /* white king */
#define BP - /* black pawn */
#define BN - /* black knight */
#define BB - /* black bishop */
#define BR - /* black rook */
#define BQ - /* black queen */
#define BK - /* black king */
I erased the exact value cause they are not usefull for you.
You must provide a good chess initial board definition in
initial_partyend (let the kid practice party end) and initial_move_learn
(let them move some piece).
Bruno.
Le sam 25/10/2003 à 13:05, Chris Puttick a écrit :
> Just been playing it (beta testing Freeduc1.4!) - what sort of programming
> skill level would I need to complete it? Basically not coded for 10 years,
> other than playing a bit with Python and PHP.
>
> -----Original Message-----
> From: Bruno Coudoin
> To: gcompris-devel
> Sent: 10/23/03 11:37 PM
> Subject: [gcompris-devel] chess position to complete
>
>
>
> Anybody interrested in completed the chess activity. I never focused on
> providing good exercices for the kids.
> It's easy to complete by editing the code in:
> chess_position.c:217:position_set_initial_partyend ()
> and just after:
> position_set_initial_movelearn
>
> There is a switch by level and you just need to fill the position using
> code like this:
> /* The white pieces */
> pos->square [E1] = WK;
> pos->square [G1] = WQ;
>
> It's sad to have a great chess game here and not to use it to all it's
> capability.
>
> Bruno.
>
>
>
>
> -------------------------------------------------------
> This SF.net email is sponsored by: The SF.net Donation Program.
> Do you like what SourceForge.net is doing for the Open
> Source Community? Make a contribution, and help us add new
> features and functionality. Click here: http://sourceforge.net/donate/
> _______________________________________________
> gcompris-devel mailing list
> gcompris-devel at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/gcompris-devel
>
>
> -------------------------------------------------------
> This SF.net email is sponsored by: The SF.net Donation Program.
> Do you like what SourceForge.net is doing for the Open
> Source Community? Make a contribution, and help us add new
> features and functionality. Click here: http://sourceforge.net/donate/
> _______________________________________________
> gcompris-devel mailing list
> gcompris-devel at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/gcompris-devel
>
More information about the Gcompris-devel
mailing list