creating a list of randomly picked out items out of a tuple list.
Im making a game in which i have an array. So far what i have done is take each 0 from said array and put those positions in a list.
What i'm trying to get to work is a system in which 12 (or any number for that matter) positions from this list gets randomly chosen and then later put into its own list.
3 Replies
so you are saying you want Random class
yes i believe so, im not too familiar with terminology
i dont know how to go about randomising tuples and then placing them into another list
you would have to use Random to generate an index
pick the item at that index from the list
add the item to the other list
if what i'm understanding is correct