Random numbers for A,B,C,D,E... no identical digit

solnikasolnika Member Posts: 132
edited November -1 in Working with GS (Mac)
Hi all,

So a few days ago I wrote a post regarding thoughts I had on my gamesalad experience .

I gave example of my struggle generating a random numbers solution, today I saw another post on this issue and thought I'll post my solution maybe it could help someone.

My way:

On game:

create 5 (or as many as you need) integer Attributes (name them 1,2,3,4,5)
create 1 actor

on the actor:

create rule: actor receives: touch: is pressed
change attributes: game.1 To game.2

create a timer (not inside the first rule)
every 0 sec
create a rule: when any:
attributes: game.1 = game.2
attributes: game.1 = game.3
attributes: game.1 = game.4
attributes: game.1 = game.5
attributes: game.2 = game.3
attributes: game.2 = game.4
attributes: game.2 = game.5
attributes: game.3 = game.4
attributes: game.3 = game.5
attributes: game.4 = game.5

change attributes: game.1 To random(1,5)
change attributes: game.2 To random(1,5)
change attributes: game.3 To random(1,5)
change attributes: game.4 To random(1,5)
change attributes: game.5 To random(1,5)

That's it, very easy to had digits.
But it can take a sec or two to generat all the digits.

Best regardes
Alex

Comments

  • CircleTimeCircleTime Member Posts: 84
    This is helpful to me. Thank you.
  • RedlerTechRedlerTech Member Posts: 1,583
    This is not the way I would do it. If you think about it again, there is a much easier way.

    You can do it this way, but I'm not exactly sure but the more rules you use the more like of the processor you use causing larger load times.

    Matt :D
  • MrshoestoreMrshoestore Member Posts: 181
    ... that is quite the suggestion NextGen. Kinda like saying "that's not right! be more right!"
  • LordTarantorLordTarantor Member, PRO Posts: 890
    In other words... pay to get the answer... hire him... Right?
Sign In or Register to comment.