Page 1 of 1

random letters

PostPosted: Sat Jul 13, 2013 10:48 am
by maarten
Hey Guys,

I am trying to get some random letters on a screen.. so i made a patch witch generates random letters and send them to textbox.. but is it possible to get a textbox on a layer do i need to use a textinput and if so how to get random letters in there ?

hope you can help

Re: random letters

PostPosted: Sat Jul 13, 2013 11:32 pm
by alverman
Use a string var content "abcdef......" and read var with random value from 1 to var len.

Re: random letters

PostPosted: Mon Jul 22, 2013 12:24 pm
by maarten
Hey Alverman,

Thanks for your reply, but to be honest I do not really understand what you mean, I hope you could explain me

grtz

Maarten

Re: random letters

PostPosted: Tue Jul 23, 2013 1:26 am
by alverman
Without much thinking about it I did so.
Definitely room for improvement but it works.

Hello, Alberto

Re: random letters

PostPosted: Sat Aug 24, 2013 1:18 pm
by maarten
Hey Alverman,

Thanks for the reply, (it took me a while to find time to play with pandora some more )

and the patch works great!! do you by any chance also know a way to connect this to the collision panel ??

thanks

Re: random letters

PostPosted: Sat Aug 24, 2013 2:45 pm
by maarten
and is there a way to make the timing of the input random also random ??

Re: random letters

PostPosted: Sat Aug 24, 2013 10:55 pm
by alverman
Bah ..... try this if all goes well

Alberto

Re: random letters

PostPosted: Sun Aug 25, 2013 7:31 am
by malkuth23
I did not actually download the code. Only looked at the screen capture...
But I think there might be a problem with your randomness.

Random generator should generate a number from 0-26
Rounding will sometimes output the number 0
Truncating will do the same thing.
But if you make the range 25, then truncate the random number, then add 1 - you should have the correct range.

Unless of course index 1 of an array is 0 and not 1... I really am not sure having not used arrays much.
Even if index 1 is actually 0, then there is still a problem with the randomness because this would mean that index 0 is half as likely to show up as all the others and 26 should not exist.
Please correct me if I am wrong.

Re: random letters

PostPosted: Mon Aug 26, 2013 9:11 pm
by Dennis Kuypers
Hi,

when using random always use floor or ceil instead of round.

Best regards
Dennis

Re: random letters

PostPosted: Tue Aug 27, 2013 9:22 am
by maarten
and is there a way to generate random values, and also generate random timing ??