Random from 11111 to 5555

I need a random number generator from 11111 to 55555 with any of these 5 numbers surpassing 5.

Comments

  • Two.ETwo.E Member Posts: 599

    Hello!

    I am sure there is an equation you could use. However, here is a simple solution.

    Best,
    Two.E

  • 3absh3absh Member Posts: 601

    Thx

  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949

    Change attribute game.randomNumber to random(11111,55555)

  • Two.ETwo.E Member Posts: 599

    @tatiang

    I don't think that was the question. Unless I am missing something, a simple random function won't work when you just want 5 random numbers that are between 1 and 5.

    Best,

  • 3absh3absh Member Posts: 601

    @Two.E it's exactly what I wanted, thx

  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949

    Yeah, it wasn't clear if it needed to be a 5-digit number or not. Using "number" in place of "digit" confused me.

  • ArmellineArmelline Member, PRO Posts: 5,397
    edited February 2019

    You can still use a simple random function. Kind of. In this example self.Number is an integer, not a string.

  • Two.ETwo.E Member Posts: 599

    @Armelline said:
    You can still use a simple random function. Kind of. In this example self.Number is an integer, not a string.

    I don't think you know how useful that is for me :smiley:
    No way I would have found this in a forum search since I didn't know I needed this till now!!

    Best,

  • ArmellineArmelline Member, PRO Posts: 5,397

    Glad to have helped! Often in GS you have to just try things and see if they work, as sometimes they do even when you wouldn't expect it!

Sign In or Register to comment.