Here's just the beginning of my code. Maybe it has something to do with using "int"?
[Please use the code tag - Rogerborg]
Code: Select all
#include <iostream>
#include "Tile.h"
//#include "Board.h"
#include <conio.h>
#include <irrlicht.h>
#include <irrKlang.h>
using namespace irrklang;
using namespace irr;
using namespace scene;
using namespace video;
using namespace io;
using namespace gui;
using namespace core;
using namespace std;
//int ROWSIZE = 3;
//int COLSIZE = 3;
enum {UP, DOWN, LEFT, RIGHT};
int swap(int);
Tile* getBlank();
int checkForWin();
u32 MAXTIME = 50000;
u32 WAITTIME = 80;
u32 MAXMOVES = 3000;
void wait();
class MyEventReceiver : public IEventReceiver
{
public:
// This is the one method that we have to implement
virtual bool OnEvent(const SEvent& event)
{
// Remember whether each key is down or up
if (event.EventType == irr::EET_KEY_INPUT_EVENT)
KeyIsDown[event.KeyInput.Key] = event.KeyInput.PressedDown;
//if (event.EventType == irr: EET_MOUSE_INPUT_EVENT)
return false;
}
// This is used to check whether a key is being held down
virtual bool IsKeyDown(EKEY_CODE keyCode) const
{
return KeyIsDown[keyCode];
}
MyEventReceiver()
{
for (u32 i=0; i<KEY_KEY_CODES_COUNT; ++i)
KeyIsDown[i] = false;
}
private:
// We use this array to store the current state of each key
bool KeyIsDown[KEY_KEY_CODES_COUNT];
};
int ROWSIZE = 3;
int COLSIZE = 3;
Tile* slots[3][3];
Tile* current;
int main()
{
// let user select driver type
video::E_DRIVER_TYPE driverType = video::EDT_DIRECT3D9;
printf("Please select the driver you want for this example:\n"\
" (a) Direct3D 9.0c\n (b) Direct3D 8.1\n (c) OpenGL 1.5\n"\
" (d) Software Renderer\n (e) Burning's Software Renderer\n"\
" (f) NullDevice\n (otherKey) exit\n\n");
char i;
std::cin >> i;
switch(i)
{
case 'a': driverType = video::EDT_DIRECT3D9;break;
case 'b': driverType = video::EDT_DIRECT3D8;break;
case 'c': driverType = video::EDT_OPENGL; break;
case 'd': driverType = video::EDT_SOFTWARE; break;
case 'e': driverType = video::EDT_BURNINGSVIDEO;break;
case 'f': driverType = video::EDT_NULL; break;
default: return 0;
}
// create device
int userTime;
cout << "How much time do you want? (in seconds)"<<endl;
cin >> userTime;
MAXTIME = userTime*1000;
cout << "How many moves do you want?"<<endl;
cin >> MAXMOVES;
..................