iOS random number a...
 

  You don't need to be an 'investor' to invest in Singletrack: 6 days left: 95% of target - Find out more

iOS random number app question

14 Posts
8 Users
14 Reactions
253 Views
Posts: 1536
Full Member
Topic starter
 

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?


 
Posted : 11/05/2024 11:23 pm
Posts: 47
Free 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?


 
Posted : 12/05/2024 12:56 am
oldnick and oldnick reacted
Posts: 1536
Full Member
Topic starter
 

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 3x3 pattern.
A random course generator forces me to take on lines that I wouldn’t think of.
Thanks again


 
Posted : 12/05/2024 8:24 am
Posts: 477
Free Member
 

I think excel has some kind of random number generator function


 
Posted : 12/05/2024 9:09 am
Posts: 7932
Free 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     |
+-----------+-----------+



 
Posted : 12/05/2024 9:43 am
Posts: 3131
Free 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/


 
Posted : 12/05/2024 9:53 am
leffeboy and leffeboy reacted
Posts: 7932
Free 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.


 
Posted : 12/05/2024 10:24 am
J-R and J-R reacted
Posts: 1536
Full Member
Topic starter
 

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


 
Posted : 18/06/2024 5:57 pm
Posts: 12865
Free 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


 
Posted : 18/06/2024 6:03 pm
kcal and kcal reacted
Posts: 1536
Full Member
Topic starter
 

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


 
Posted : 18/06/2024 11:09 pm
Posts: 7433
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.


 
Posted : 18/06/2024 11:36 pm
J-R and J-R reacted
Posts: 11292
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!)...


 
Posted : 19/06/2024 6:55 am
J-R and J-R reacted
Posts: 7932
Free Member
 

random_number


 
Posted : 19/06/2024 7:57 am
Posts: 12865
Free 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.


 
Posted : 19/06/2024 10:26 am
Posts: 1536
Full Member
Topic starter
 

@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.


 
Posted : 19/06/2024 1:59 pm
J-R and J-R reacted

6 DAYS LEFT
We are currently at 95% of our target!