Increment a group of variables randomly

Hello guys,
I hope someone can help me with a problem that I’m having. I have 4 int variables (Card 1, Card 2, Card 3, Card 4) that I want to increment each turn. When I start the first turn I want the output to be something like this:

  • Card 1 - Value 2
  • Card 2 - Value 1
  • Card 3 - Value 0
  • Card 4 - Value 1

When I start another turn, I want to increment randomly again, but not losing the previous values (I was thinking something like incrementing a temporary variable and then adding it to the Card 1/2/3/4 variable). I’m just having some problems understanding how I will increment the group of variables randomly. Do you guys have any idea or suggestion?
Best regards!

Thank you so much!
I will try it and let you know if I was able to do it

It works :slight_smile:
I just need to understand how to force the increment to increment at least one of the four (so I don’t have a round where all the increments are 0) and I’m good to go.
Thanks a lot man!

all you really need to go is get the variable then add a random int to it and set it. easy peasy.

or if you wanted to use an array to store the values then you would use a for each loop and then do basically the same thing but with a set array element.

you could just force at least one to increment manually.

i also created a few more examples of how you could implement this. the top example will increment one of the cards at random by a int of one. the lower example will do the same thing but it will run between 0 and four times, so it could increment them all by 1 or it could increment one card 3 times, or any combination of cards. very random haha

I really appreciate what you are doing man!
I loved the second alternative because I think it’s the most similar to what I need (Increment each card by 1 or increment just one card 4 times for example). I tried it like this (Ignore the compareint, is just for testing) and sometimes the card number decreases. Do you have any idea why?