I've tried everything I could think off, yet my problem stays.
I'm trying to make Dungeon Crawl (beginner exercise) and I think I'm almost done, but for some reason, when I make my first move, the program exits.
#include <iostream>
#include <cstdlib>
usingnamespace std;
int Check_Move(int a, int b)
{
int richting;
cin>>richting;
if (richting == 1)
b = b-1;
if (richting == 3)
b++;
if (richting == 2)
a++;
if (richting == 5)
a = a-1;
return a;
return b;
}
#include <iostream>
#include <cstdlib>
usingnamespace std;
int Fout_Move(int a, int b, int x)
{
if (a == 6 && b == 7)
{
x = 2;
}
elseif (a == 4 && b == 4)
{
x = 2;
}
elseif (a == 5 && b == 7)
{
x = 2;
}
elseif (a == 7 && b == 9)
{
x = 3;
}
return x;
}
im not an expert so i dont know what you mean by dungeon crawl. but if you mean like a simple console RPG check out xoax.net, from the looks of it your objects aren't interacting with each-other like you want. in your takenboard cpp your returning a and b you cant call return twice in a function. the first one causes it to stop b4 the second gets read. and your not returning it to anything. you did get really close to the basic structure but check the link i gave you it has a good explanation how to make a console RPG. but if this is not what u r doing then NVM.