Skip to content

Instantly share code, notes, and snippets.

@ziggi
Created April 27, 2015 19:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ziggi/f4dd2a283aebb5e27095 to your computer and use it in GitHub Desktop.
Save ziggi/f4dd2a283aebb5e27095 to your computer and use it in GitHub Desktop.
stock ReturnRandomSymbol(bool:uppercase = true, bool:lowercase = true)
{
new value = -1;
if (uppercase && lowercase) {
value = random(2);
}
if (uppercase && (value == 0 || value == -1)) {
value = mathrandom('A', 'Z');
}
if (lowercase && (value == 1 || value == -1)) {
value = mathrandom('a', 'z');
}
return value;
}
stock mathrandom(min, max)
{
return (random(max - min + 1) + min);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment