Hi guys. I am making a game called Bejeweled, I thought I would start this by making an array with random numbers from 0 to 4 (for the 5 gems). I would then transfer this array and assign the gems to each of the numbers.
I would appreciate any ones take on why this program always returns the same values.
This still returns the same values. Also if I change the rand function to say 1... It still outputs the same values.
This seems highly illogical as this should make all the values in the array 1...
I have tried copy and pasting the code to another new C++ source file and build-run again but still the same values appear.
Also as a quick note, I have put square brackets around my code and I can't see a change in the post..
Thanks NwN. That looks clearer now.
I have got the whole array to fill with random numbers.
A quick question... If I define an array board, does that give me a range board to board or board.
I'm pretty sure it's  but just to be sure.
Thank you for all your help guys. I'm sure you will see me pop up over the next 11 weeks for my project.
If you guys ever need help with something non c++ related, i'm your man! haha
You are telling the compiler "board is an array of 8 integers".
But because arrays are zero indexed, meaning the first element is at position board, the last position of the element will always be max_amount-1, in your case, 8-1, board.