I cant figure this out, i am not quit sure i understand what your saying about my next_room function, maby an example would help, i am a very visual learner, oh and yes the map is unchanging.
i tryed some diffrent ways but none seem to work i must going at this in the wrong way.
Code:
int next_room (int room, int direction){
int map[room][direction]={
{1, 2,-1,-1},
{2, 0,-1,-1},
{0, 1,-1, 3},
{-1,-1,2,-1}
};
return map[room][direction];
}
or
Code:
int next_room (int map[][]){
int map[room][direction]={
{1, 2,-1,-1},
{2, 0,-1,-1},
{0, 1,-1, 3},
{-1,-1,2,-1}
};
return map[room][direction];
}
or
Code:
# define max_room 4
# define max_die 4
.
.
.
int next_room (map[room][directions]){
int map[max_room][max_die]={
{1, 2,-1,-1},
{2, 0,-1,-1},
{0, 1,-1, 3},
{-1,-1,2,-1}
};
return map[room][direction];
}
edit:
or ///this one has one error, parse error "=".
Code:
# define max_room 4
# define max_go 4
int next_room (int a, int b, int map[max_room][max_go]={
{1, 2,-1,-1},
{2, 0,-1,-1},
{0, 1,-1, 3},
{-1,-1,2,-1}
}){
}
or have i forgotten my brains today.