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.

P#145825 2024-04-05 18:42 ( Edited 2024-04-05 18:47)

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 ^^

P#145830 2024-04-05 19:50
1

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

P#145855 2024-04-05 22:09

[Please log in to post a comment]