/* OK first of all, when I wrote this, I just copied my c code and translated to java.
I had never written any java code ever before, and now, three years later, I find this
code horrible.
But because of the many requests for the code I've decided to put out the code anyway,
but I warn you, don't code like this!
Note that this engine doesn't think ahead, it just evaluate the current position.
The best way to proceed is maybe to modify the Analyze function and use it with the
MiniMax algorithm. I actually started coding some think-ahead but I think i'ts
commented below.
Well that's it, and good luck!
Staffan Ekvall
pnyxtr@yahoo.com
*/
import java.awt.*;
import java.awt.image.*;
import java.net.*;
import java.applet.*;
//import java.util.math;
public
class Connect5 extends Applet
{
char Board[][][] = new char[32][32][2];
int PointBoard[][] = new int[32][32];
int x, y;
int startx = 15, endx = 15, starty = 15, endy = 15;
int white;
int black;
char cleararea = 1;
static final int PLAYING = 0;
static final int NOTPLAYING = 1;
static final int WAITING = 1;
static final int YOUWON = 2;
static final int YOULOST = 3;
int status = NOTPLAYING;
int picturestatus = WAITING;
int status2[] = { 0, 0 };
int fx, fy;
static final char EMPTY = 0;
static final char MARKX = 1;
static final char MARKO = 2;
static final char EDGE = 3;
static final int FIVE = 80000;
static final int FOUR = 12000;
static final int THREE = 500;
static final int THREEHOLE = 450;
static final int FOURBLOCK = 450;
static final int FOURBLOCKHOLE = 400;
static final int TWO = 50;
static final int TWOHOLE = 45;