Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Getting a random number wihout RND.
#22
Hi guys, been a few years and I thought I would play my hand in some programming again. So I saw this thread and tried it out.
I will admit I used Chat GPT for some of it, but someone has to learn someway. I changed it a bit also making the user able to choose
the highest number and also I added more randomness to it by using the seconds in time$ and then dividing that by 10 and then using that variable
to times it by timeSeed. It works pretty good. Probably not as random as RND, but what do you think?

Code: (Select All)

Cls
start:
s$ = Time$
s1$ = Right$(s$, 2)
s2 = Val(s1$)
s = s2 / 10
Print "Type the highest number for me to choose from."
Input "->", most
If most < 1 Or most > 1000000000 Then GoTo start:
timeSeed = Timer ' Get the system time in seconds
timeSeed = timeSeed * s
randomNumber = (timeSeed Mod most) + 1
Print "Random Number: "; randomNumber
Print: Print: Print
GoTo start:
Reply


Messages In This Thread
Getting a random number wihout RND. - by Dav - 09-30-2023, 11:01 PM
RE: Getting a random number wihout RND. - by Dav - 09-30-2023, 11:06 PM
RE: Getting a random number wihout RND. - by Dav - 09-30-2023, 11:27 PM
RE: Getting a random number wihout RND. - by Dav - 10-01-2023, 01:45 AM
RE: Getting a random number wihout RND. - by Pete - 07-17-2024, 07:00 PM
RE: Getting a random number wihout RND. - by Pete - 07-17-2024, 07:42 PM
RE: Getting a random number wihout RND. - by Pete - 07-17-2024, 09:00 PM
RE: Getting a random number wihout RND. - by Pete - 07-17-2024, 10:08 PM
RE: Getting a random number wihout RND. - by SierraKen - 08-10-2024, 05:15 AM



Users browsing this thread: 1 Guest(s)