I'm trying to get an arrangement of tic tac toe boards. So I have the following code:
// 5 turns for x if x goes first
std::string moves = "xxxxxoooo";
do {
std::cout << moves << std::endl;
} while ( std::next_permutation(moves.begin(), moves.end()) );
But it only outputs the original string once. I'm assuming that each character has to be unique. What's a way I can do this?
See Question&Answers more detail:os