New to C++ and Programming in General. Have a quick question about my code.
I would just use an array in the function, but obviously the legal moves will grow and shrink, so I thought a vector would be a better fit. The question is in the comment under the if condition--Code://Legal Move Generator void legal_move(vector<int> &move, position board[], int size); //Generate Moves void legal_move(vector<int> &move, position board[], int size){ int counter = 0; for(counter; counter <= size; counter++){ if(board[counter].occupied == 0){ //Assign the value of counter to the vector move, and so on } } }
Thanks for any help.




Reply With Quote