0

At the moment i know how to move an element from one vector to the other. The issue is i want to move the element randomly instead of choosing the element. Code is below.

auto it = find(deck.begin(), deck.end(), 3);
    if (it != deck.end()) {
        player1.push_back(*it);
        deck.erase(it);
    }

This moves an element from one vector to the other but i have to choose the element by typing it in as you can see from the number three. Does anyone have any idea on how to do this randomly.

François Andrieux
  • 28,148
  • 6
  • 56
  • 87
coder
  • 45
  • 9

0 Answers0