Home Forums Chat Forum iOS random number app question

Viewing 15 posts - 1 through 15 (of 15 total)
  • iOS random number app question
  • oldnick
    Full Member

    Ideally I’d like to generate a list of numbers (range 1-9) each with a suffix of clockwise / anti-clockwise.

    Failing that random numbers from the range 1.0, 1.5, 2.0, 2.5 – 8.5, 9.0, 9.5

    Does such an app exist?

    1
    mattstreet
    Full Member

    Not sure about any app, haven’t looked, but plenty of RNG websites…

    Could you use Google’s integer RNG:  https://g.co/kgs/YFWHqVm – set the range to -9 to 9, with negative number signifying anticlockwise, positive clockwise, and ignore zeros?

    oldnick
    Full Member

    That sounds spot on, I shall have a look later after my bike ride.
    It is a very important project 🤔, I have a large area of bricks and rocks that I drive my rc rock crawler over, and 9 markers set out in a 3×3 pattern.
    A random course generator forces me to take on lines that I wouldn’t think of.
    Thanks again

    towpathman
    Full Member

    I think excel has some kind of random number generator function

    Flaperon
    Full Member

    If you’ve got a desktop computer than a simple Python program can do what you want:

    import random
    from prettytable import PrettyTable
    
    def generate_list(n):
    directions = ['CW', 'CCW']
    return [(random.choice(directions), random.randint(1, 9)) for _ in range(n)]
    
    n = int(input("Enter the length of the list: "))
    path = generate_list(n)
    
    table = PrettyTable()
    table.field_names = ["Direction", "Magnitude"]
    
    for direction, magnitude in path:
    table.add_row([direction, magnitude])
    
    print(table)

    This produces a list like this:

    Enter the length of the list: 10
    
    +-----------+-----------+
    | Direction | Magnitude |
    +-----------+-----------+
    |    CCW    |     9     |
    |    CCW    |     6     |
    |    CCW    |     5     |
    |    CCW    |     5     |
    |     CW    |     5     |
    |     CW    |     6     |
    |     CW    |     2     |
    |     CW    |     8     |
    |    CCW    |     8     |
    |    CCW    |     3     |
    +-----------+-----------+
    
    
    
    1
    StirlingCrispin
    Full Member

    The above are pseudo-random 😉

    In reality, most random numbers used in computer programs are pseudo-random, which means they are generated in a predictable fashion using a mathematical formula. This is fine for many purposes, but it may not be random in the way you expect if you’re used to dice rolls and lottery drawings.

    For truely random numbers:

    https://www.random.org/

    1
    Flaperon
    Full Member

    The above are pseudo-random 😉

    True, but pseudo-random number generators are perfectly acceptable for modelling and simulations. So unless oldnick intends to use the random path to encrypt something, for all intents and purposes the RNG in python can be considered random.

    I’ve not bothered to do the maffs, but I suspect that given the OP is generating a relatively short sequence restricted to the integers 1-9, you’d be more likely to duplicate the run by using a true random number generator than a PRNG.

    oldnick
    Full Member

    Finally getting round to this, can anyone recommend a python emulator app for iOS?
    Main things are; free and numpty tolerant.

    1
    zilog6128
    Full Member

    dunno but did you know ChatGPT can not only write Python but also then execute it in a sandboxed environment? Took less than a minute to type in the request & get the result!

    numbers

    oldnick
    Full Member

    Blimey, that’s quicker and probably more reliable than me typing it in 😳

    1
    thecaptain
    Free Member

    Got to LOL at the idea that anyone would rely on chatGPT for generating (pseudo-)random numbers.

    If you don’t really care about the randomness, it might be just fine of course.

    1
    DickBarton
    Full Member

    Which website does STW use for the Christmas draw? That seems to be random (and not just because it hasn’t pulled my winnings number out the bag!)…

    Flaperon
    Full Member

    random_number

    zilog6128
    Full Member

    Got to LOL at the idea that anyone would rely on chatGPT for generating (pseudo-)random numbers.

    your laugh is the laugh of the dumb 😂 It’s no more or less random than most other software-based “random” numbers.

    1
    oldnick
    Full Member

    @zilog6128 how B Whilst I appreciate how seriously some people are taking the random/pseudo-random/less than pseudo-random discussion, may I remind you that the task is concerned with driving a toy car over some stones in my garden.

    Frankly, if the suggested course doesn’t look “random enough” I’ll click repeat until it does.

Viewing 15 posts - 1 through 15 (of 15 total)

You must be logged in to reply to this topic.