How do I generate a random character string

Get help using Construct 2

Post » Sun Oct 22, 2017 7:23 pm

This way I generate a random letter from a constant string.

mid("ABCDEFGHIJKLMNOPQRSTUVWXYZ", random(0,26), 1)
B
23
S
5
G
1
Posts: 17
Reputation: 1,787

Post » Mon Oct 23, 2017 10:55 am

Thanks for the reply. I've been using

Keyboard.StringFromKeyCode(floor(random(42)+48))

for the last 2 years or so to generate random characters, but your option is probably simpler. ;)
I suppose the index should be random(0,25) (instead of (0, 26) ) in your example, though?
B
33
S
6
G
1
Posts: 355
Reputation: 2,850

Previous

Return to How do I....?

Who is online

Users browsing this forum: R0J0hound and 33 guests