// $Id: QuickStart.htm 119 2004-05-16 00:02:24Z ggs_mburo $ // This is a GGS file, licensed under the GPL QuickStart Guide

Getting Started

Compile the unaltered source code

This is the first release and so far is known only to compile on a few machine/os/compiler combinations. Therefore you should first check that the unaltered source code compiles on your machine. If it doesn't compile email me, I would like to get it to work on more machines.

Connect to GGS

Porting to ODK

If you are adding your program to ODK the following troubleshooting guide may prove useful:

ErrorMultiply defined: istream (or any other C++ standard library object)
IssueODK requires new-style headers, e.g. <iostream> rather than the older <iostream.h>
SolutionIn your code, change
#include <iostream.h>
To
#include <iostream>
using namespace std;
Erroranything related to BLACK, WHITE, EMPTY, DUMMY
IssueODK defines the constants COsBoard::BLACK, etc. and you have #defined BLACK, etc.
SolutionIn your code, change
#define BLACK 1
to
const int BLACK=1;
which regards namespaces, is type-safe, and improves compiler error checking.

Basic modifications

To send a command to Lion, you output to the stream. From within a message handler you would say:

(*this) << "tell .chat Hello World!\n";
flush();
To send the message "Hello World!" to the chat channel. Don't forget the '\n' (needed by the GGS parser) or the flush() which sends the message to GGS.

Tips

If your program doesn't have a learning book (i.e. learn from its mistakes in games) try 'rand' games which have a random starting position.

To write a very strong program, check out the papers by Michael Buro.

In ODK arrays, index 1 is for white and 0 is for black. This allows you to use game.pos.board.iMover as the index.