+ 1

Fill a vector with random numbers 1-9?

Ok, So I just asked a similar question, but I thought I'd make it easier to understand. I want a function that will fill a vector with each digit 1-9. Each digit is only to be used once. I know how to generate random numbers, but I every attempt has somehow generated strange numbers (like -27263118 or 33783728) or it just pushed a few numbers the vector. If you need me to show what I've tried, I'll have to re-write something.

27th Mar 2019, 5:43 PM
Daniel Cooper
Daniel Cooper - avatar
3 Antworten
+ 1
Anna This is perfect. Would you mind adding comments explaining the code?
27th Mar 2019, 9:04 PM
Daniel Cooper
Daniel Cooper - avatar
+ 1
Daniel Cooper Thank you. Done ☺️
27th Mar 2019, 9:23 PM
Anna
Anna - avatar