Log In  


tbh I'm trying to program a digital oracle deck of cards for personal use, and I can't seem to find a way to code for "picking card(s)" without doubles. Maybe with some keyboard entry for indicating the program to choose x items from the randomized array.

1


1

I'd look into how a queue data structure works! Basically, you'll be deleting the card you draw from your "deck" each time you draw it, but you can keep track of it elsewhere. If you want to shuffle it, you could run a loop that swaps the place of 2 random cards in the deck a buncha times. Other people on here have made solitaire, so it might be worth looking at their code to see how they did it ^^


1

@Maeve okay I’ve found a basic lua tutorial about doing “card shuffling” and it works (with some modifications to the code)



[Please log in to post a comment]