Quote:
1) Arrays in C/C++ always start from '0' not '1'
So in your loops is: for ( int row = 0; row < 20; ++row) { ... }
2) In lines 16-25 of the posted code, the moment you find a value of 0 and make it 1 you have also set=true which will terminate the loop. That is the loop will run only 1 time cause everything in the array is set to 0 and so the 1st value it'll find will be 0!!! So instead of checking the value set, make a variable that counts to 40 and then terminate the loop.
3) You **probably** not have exactly 40 values set to 1 because there's a possibility that aux2 and aux3 take values that points to an element already set to 1. If you have 39 elements set to 1 there's a ~10% possibility to select an element set to 1.
Quote:
2) In lines 16-25 of the posted code, the moment you find a value of 0 and make it 1 you have also set=true which will terminate the loop. That is the loop will run only 1 time cause everything in the array is set to 0 and so the 1st value it'll find will be 0!!! So instead of checking the value set, make a variable that counts to 40 and then terminate the loop.
That loop will run until a value is set to 1. It is SUPPOSED to terminate after setting exactly one value that is a 0 to 1. The fact that it gets called 100 times should guarantee that 100 seperate 0's are changed to 1. I think that the main reason that Hardstyle isn't always getting 100 1's is because he's ignoring a whole bunch of values by starting his arrays at 1 instead of 0. Of course you aren't going to find all 100 1's if you only check part of the array!
General structure of a for loop that iterates through an array should be:
for(int i = 0; i < count; i++)
NOT
for(int i = 1; i < count; i++)