Initially, just to confirm that that the array saveColour[][] and associated code is functioning correctly, you can omit the call to srand().
The only requirement for calling initColour(); is that it should take place before any calls to OGWindow::drawGrid(). Just put it somewhere near the start of the main function.
Once that is in place and working, put a call to srand(time(NULL)); just before the call to initColour()
yeh i'm using multiple files. Essentially, i'm doing coursework and the requirement is to create an AI program that automatically solves a maze (with varied results each run) and displays the results. That is where the marks lie.
The part I'm doing is completely unnecesary and gains me no extra credit, I know because i asked. I could just as easily have no random maze whatsoever and just one staple maze.
But i don't like easy, and because of all the time i put in, i want this and don't want to cop out..
Ok I see. Well, if it's nearly there, you may as well complete it. Even if you don't earn extra credit, somewhere down the line, the knowledge and experience gained will pay off.
..and it is back to changing colours on its own constantly every second :(
If you are actually using squareColour = saveColour[xValue][yValue];
then the implication would be that function initColour() is being called more than once.
exactly, plus i think itll help for final testing because if the AI is still operating correctly despite different mazes, there's less likelihood of a random error sneaking up on me in marking.
If you are actually using squareColour = saveColour[xValue][yValue];
then the implication would be that function initColour() is being called more than once.
that sounds like what is happening. So basically, I've redone what i had at the start in a more efficient way but not solved the problem xD?
and thanks again, i'm still learning heaps from this even if i'm encountering problems.
I can only suggest again, make sure that initColour() is called just once at the start of the program. It sounds like you may have it caught up inside a loop somewhere.