[SOLVED]Checking number groups

Before proceeding, please use the forum search feature at the top of the page to check if your question has already been answered.

How do I…

CONTEXT I am trying to make a card game where you have a deck with 4 different suits and each suit has 10 cards from (1-10 as values). The idea of the game is that you are dealt 3 cards from the deck as seen in the picture below. (Deck is on left and cards that are discarded are on right)

SO what I am trying to do is that I need to group values like (0,10,20,30) (everyone of them would equal as 1 but different suit) So when the discarded deck has card let’s say Ace of spades (in this case the variable value would be 0) top of it i should be able to put every other Aces( variable values of 10,20,30) top of it too from my hand. SO how can I check if there are other Aces (10,20,30) in my hand variables. I know how this can be made manually but I need solution for every different variations because the discarded deck value could be 20 and it would be Ace of Hearts for example. Then it should still check from the “Ace group” if there are another Aces. And because I need this to work with every values not just Aces.
Thank you, I appriciate if you help me. And if this explanation missed something ask for more info.

Are you using an object for each card or are you storing them in an array? There isn’t a wrong answer. I think we just need a few more details.

Thank you for your reply, I managed to solve this!

1 Like

Can you share your solution for people who might have a similar issue and find this post?