cant figure out why this happens

I created a 2D array called school and inside the school is a lunch and a janitor. They both randomly move and if they land on top each other, the janitor has caught the lunch. For some reason the janitor consistently moves to the top left corner (the (1, 1) position. I can't figure out why. I put the code in pastebin because it is rather long, and I felt it was necessary to give the whole program.

Header with the classes:
http://pastebin.com/gtuFjVR6

Function definitions:
http://pastebin.com/ed4GnyWm

main function:
http://pastebin.com/CD04U86z

I apologize for readability and documentation, as I am disgustingly bad at it.
Might this be the reason?
1
2
3
4
5
6
7
8
9
void place_me(school & skool, Lunch & lunch, const int Size)//randomly places
//lunch position
{
  lunch.Xpos = 1;
  lunch.Ypos = 1;
  //lunch.Xpos = (rand() % (Size - 2)) + 1;
  //lunch.Ypos = (rand() % (Size - 2)) + 1;
  skool.School[lunch.Xpos][lunch.Ypos] = lunch.LunchRep;
}


The lunch.Xpos and lunch.Ypos never get different positions.
huh...that looks like a stupid mistake 0.0
Topic archived. No new replies allowed.