The online racing simulator
[Solved]How to get Random Letters
Is random numbers

<?php 
SetCurrentPlayerVar
"key"roundToNumRandomNum100000,999999 ) ),) );
?>

Do you know how to do random letters?


<?php 
SetCurrentPlayerVar
"sorts"roundToNumRandomSortsAAA,ZZZ ) ),) );
?>

#2 - Krayy
Just genrate random numbers from 1 to 26 and use them to map to a letter i.e. 1 = A, 2= B etc
I need to do three random letters.

Example: ABC or VBY
And can't you generate 3 random letters using Krayy's method?
The code should look like?
you need to generate an ASCII code, and then convert it to a letter.

Or, you could do an array with all the letters and then generate a number between 0 and 26. So you would make lettersArray[randomNumber] to get that letter.
I do not understand how you can show an example?
Did not tried it, but in php (and pretty much any language without the $ symbol) it should look like this:


<?php 
$lettersArray
('ABCDEFGHIJKLMNOPQRSTUVWXYZ');
for (
$i=0$i<3$i++)
{
   
$string="";
   
$string.=$lettersArray[round(ToNumRandomNum(0,26 ))]; //0 to 26 - asuming you create 26 letters in the array
}
SetCurrentPlayerVar"key"$string,) ); 
?>

-
(DarkTimes) DELETED by DarkTimes : Wrong language
And this will work .lpr files?
This thread is closed

FGED GREDG RDFGDR GSFDG