I'm trying to make a card game in visual studio. The function I'm stuck on is taking a card out of the deck (the list). I use the following random number function tied to a button click.
List<int> Deck = new List<int> { 0, 1, 2, 3};
Random R = new Random();
Int Card = R.Next(Deck.Count);
Deck.Remove(Card);
The problem is after I press the button again it doesn't remove the int from the list, the list just goes back to how it was before I removed the int. How would I go about removing the int from the list permanently?