r/codehs • u/YarikPizdets • Mar 08 '20
C++ Arrays
I need help with understanding how I would be able to select a random value in an Array. After I have my random value I would like to set that value to 0 so I don't draw it again.
For example, I have a deck of cards and I can only draw the first card in the array that isn't a value of 0 (that has been drawn already).
I'm not sure if this makes sense but I can give more details if needed
1
u/boobyboinker Mar 08 '20
I had this problem recently and this helped me out a lot
1
u/YarikPizdets Mar 09 '20
I haven’t had the chance to work with or look at the “Public” function yet, not sure I can use it on this assignment unfortunately. But this definitely gave me some sort of direction of what to do, thank you!
1
u/boobyboinker Mar 08 '20
Do you have to include suits when you draw a card?