From stepheng@australia.edu Thu Dec 13 08:57:23 2001
Received: from australia.edu (gold.internet-media.net [216.15.179.130])
	by swi.psy.uva.nl (8.11.6/8.11.2) with SMTP id fBD7vM513347
	for <prolog@swi.psy.uva.nl>; Thu, 13 Dec 2001 08:57:23 +0100 (MET)
Received: from arisu ([202.67.112.228]) by australia.edu ; Thu, 13 Dec 2001 16:33:39 -0600
Reply-To: <stepheng@australia.edu>
From: "Stephen Gilmour" <stepheng@australia.edu>
To: <prolog@swi.psy.uva.nl>
Date: Thu, 13 Dec 2001 18:57:23 +1100
Message-ID: <KGEJIKMCOEAJFDOPBPGAEEBGCBAA.stepheng@australia.edu>
MIME-Version: 1.0
Content-Type: multipart/mixed;
	boundary="----=_NextPart_000_0005_01C18407.FFBA6E10"
X-Priority: 3 (Normal)
X-MSMail-Priority: Normal
X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2910.0)
Importance: Normal
X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4522.1200
In-Reply-To: <010601c1835f$edf25ce0$7514a8c0@gnp.com>
Subject: [SWIPL] SWI-cpp.h throwing an exception for an unknown reason.

This is a multi-part message in MIME format.

------=_NextPart_000_0005_01C18407.FFBA6E10
Content-Type: text/plain;
	charset="iso-8859-1"
Content-Transfer-Encoding: 7bit

This class keeps throwing an exception and I don't know why.  It happens on
line 20:

PlTermv av(10);

I have no idea why this is occuring and any help would be useful.

Steve

------=_NextPart_000_0005_01C18407.FFBA6E10
Content-Type: application/octet-stream;
	name="computer.cpp"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: attachment;
	filename="computer.cpp"

#include "computer.h"

computer :: computer (move *move_check, int player, int w, int h, char =
**argv)
{
	WINDOW_WIDTH =3D w;
	WINDOW_HEIGHT =3D h;
	pl =3D player;
	move_hold =3D move_check;
	PlEngine e(argv[0]);
}

computer :: ~computer (void)
{
}

int computer :: make_move (int loc)
{
	cout << "Computer" << pl << ": " << loc << endl;
	PlTermv av(10);
	cout << "config" << endl;
	for (int i =3D 0; i < 9; i++)
	{
		av[i] =3D move_hold->request_answer (i);
		cout << (char *)av[i];
	}
	cout << endl;
	PlQuery q("solve", av);
	loc =3D (int) av[9] - 48;
	cout << "Location for Computer move" << loc;
	int temp =3D move_hold->make_move (loc, pl);
	if ((temp =3D=3D 1) || (temp =3D=3D 2))
	{
		draw_move (loc);
	}
	if (temp =3D=3D 2)
	{
		clock_t goal;
		clock_t wait =3D 3000;
		goal =3D wait + clock();
		while( goal > clock() )
			;
	}
	return temp;
}

void computer :: draw_move (int loc)
{
	if (pl =3D=3D 1)
	{
		draw_cross (loc);
	}
	else
	{
		draw_circle (loc);
	}
}

------=_NextPart_000_0005_01C18407.FFBA6E10
Content-Type: application/octet-stream;
	name="computer.h"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: attachment;
	filename="computer.h"

#ifndef COMPUTER_H
#define COMPUTER_H

#include "player.h"
#include <time.h>
#include "SWI-cpp.h"
#include <iostream.h>

class computer : public player
{
public:
	computer (move *move_check, int player, int w, int h, char **argv);		// =
constructor
	~computer (void);														// deconstructor
	int make_move (int loc);
private:
	void draw_move (int loc);
	int pl;
};

#endif

------=_NextPart_000_0005_01C18407.FFBA6E10--

