How to strip characters out of uuid to use as a random seed

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10053
Joined: Sat Apr 08, 2006 7:05 am
Contact:

Re: How to strip characters out of uuid to use as a random s

Post by FourthWorld » Tue Jun 24, 2014 5:48 am

shawnblc wrote:
FourthWorld wrote: What problems did you encounter with the default randomseed?
When using randsomseed, closing the program & removing from memory, then restarting the stack I'd get the same repeated line using randomseed or using any line. Both on OSX 10.93 and Windows 7 (vmware). Anytime my stack is called I'd like it truly random. Not a repeat of the same sequence.
Do you get a better result if you just leave the randomSeed alone?
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

shawnblc
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 342
Joined: Fri Jun 01, 2012 11:11 pm

Re: How to strip characters out of uuid to use as a random s

Post by shawnblc » Tue Jun 24, 2014 9:50 am

FourthWorld wrote:
shawnblc wrote:
FourthWorld wrote: What problems did you encounter with the default randomseed?
When using randsomseed, closing the program & removing from memory, then restarting the stack I'd get the same repeated line using randomseed or using any line. Both on OSX 10.93 and Windows 7 (vmware). Anytime my stack is called I'd like it truly random. Not a repeat of the same sequence.
Do you get a better result if you just leave the randomSeed alone?
No. Wish I did.

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10053
Joined: Sat Apr 08, 2006 7:05 am
Contact:

Re: How to strip characters out of uuid to use as a random s

Post by FourthWorld » Tue Jun 24, 2014 8:24 pm

What problems are you seeing?
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

sefrojones
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 447
Joined: Mon Jan 23, 2012 12:46 pm

Re: How to strip characters out of uuid to use as a random s

Post by sefrojones » Tue Jun 24, 2014 9:27 pm

Hey Shawn,

I just tested "put any line" of a 10k line text document, and it seems to be pretty random. I close the stack and open it again, and I get a different set of results. Check this Super simple stack that references a 10,000 line txt doc on my google drive:

It seems to be working fine on my end.

It's just one button and one field, with this as the button script:

Code: Select all

on mouseUp
   put url "https://9f3842e07d8c6feae8cc3e01e8f91f10f3587794.googledrive.com/host/0B9myvEGzDKvCOWVEYlVoYUJpWms/myData.txt" into tText
   put any line of tText &cr after fld 1
end mouseUp
Attachments
RandomLineTest.livecode.zip
(667 Bytes) Downloaded 175 times

shawnblc
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 342
Joined: Fri Jun 01, 2012 11:11 pm

Re: How to strip characters out of uuid to use as a random s

Post by shawnblc » Tue Jun 24, 2014 10:03 pm

sefrojones wrote:Hey Shawn,

I just tested "put any line" of a 10k line text document, and it seems to be pretty random. I close the stack and open it again, and I get a different set of results. Check this Super simple stack that references a 10,000 line txt doc on my google drive:

It seems to be working fine on my end.

It's just one button and one field, with this as the button script:

Code: Select all

on mouseUp
   put url "https://9f3842e07d8c6feae8cc3e01e8f91f10f3587794.googledrive.com/host/0B9myvEGzDKvCOWVEYlVoYUJpWms/myData.txt" into tText
   put any line of tText &cr after fld 1
end mouseUp
So am I understanding correctly that put any line (LC) uses a randomseed automatically at launch, BUT you can specify a randomseed if you want? Definitely, seems to be working.
Attachments
RandomLineTest-2.livecode.zip
(1.12 KiB) Downloaded 169 times

sefrojones
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 447
Joined: Mon Jan 23, 2012 12:46 pm

Re: How to strip characters out of uuid to use as a random s

Post by sefrojones » Tue Jun 24, 2014 10:07 pm

shawnblc wrote:
So am I understanding correctly that put any line (LC) uses a randomseed automatically at launch, BUT you can specify a randomseed if you want? Definitely, seems to be working.
I believe this is indeed the case.

shawnblc
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 342
Joined: Fri Jun 01, 2012 11:11 pm

Re: How to strip characters out of uuid to use as a random s

Post by shawnblc » Tue Jun 24, 2014 10:10 pm

sefrojones wrote:
shawnblc wrote:
So am I understanding correctly that put any line (LC) uses a randomseed automatically at launch, BUT you can specify a randomseed if you want? Definitely, seems to be working.
I believe this is indeed the case.

Thanks sefrojones. Very much appreciated.

I'm sure one of the veterans will chime in. That's what I gather too.

Post Reply