Jump to content
Sign in to follow this  
Hash

Generate random String

Recommended Posts

Oh. Well maybe I should learn a lil bit about java before posting on a rsps forums lololol<.<

Share this post


Link to post
Share on other sites
random number then use a case selection, idk java but its in other languages ik xD

Share this post


Link to post
Share on other sites
[quote name='viroware']random number then use a case selection, idk java but its in other languages ik xD[/QUOTE]
a case selection? ill assume you mean using a switch statement which is a terrible idea for this, considering a switch is just general matching (i won't go as far as saying 'pattern matching' because it's not that powerful). an if statement would suffice

Share this post


Link to post
Share on other sites
public static String[] colour = {"Red", "Blue", "Orange"};

to grab the random string you can make like, System.out.println(colour[Misc.Random(2)]);

or

System.out.println(colour[Misc.Random(1)]);

depending on your Random method...

Share this post


Link to post
Share on other sites
[quote name='Arrav']public static String[] colour = {"Red", "Blue", "Orange"};

to grab the random string you can make like, System.out.println(colour[Misc.Random(2)]);

or

System.out.println(colour[Misc.Random(1)]);

depending on your Random method...[/QUOTE]
You realize how old this thread is right???

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×