Ultimate Gear War
Join the alien war, prepare your gear and protect your base at all cost!
4.26 / 5.00 12,931 ViewsSo, I've got this code, more like a script. It's a random generator for my role-plays. Got it all coded nice and neat runs perfectly....... In command line. How do I make this
<pre>
package role.play.generator;
import java.util.Random;
public class RolePlayGenerator {
public static void main(String[] args) {
Random randomgenerator = new Random();
int hairsel = randomgenerator.nextInt(5);
int clothsel = randomgenerator.nextInt(4);
String[] clothtypes = {"Dress","Skirt","Robe","Pants"};
String[] haircolours = {"Blue", "Red", "Blonde","Black","Purple"};
double height = Math.floor(Math.random()*9+58);
String Haircolour="Hair Colour:"+haircolours[hairsel];
String Clothing="Clothing:"+clothtypes[clothsel];
String Height = "Height:"+height+" Inches";
System.out.println(Height);
System.out.println(Clothing);
System.out.println(Haircolour);
}
}
Output the prints, into a window with a button to run it again?
I'm week in and this is only functional as of yesterday.
Sorry about the formatting fail.
Did a little research going to do some tutorials, maybe repost this thread if I still can't do it.
Sorry about the formatting fail.
You know what would help?
Telling us what language you're writing this in. That's a fundamental thing we MUST know to be able to help.
You're also giving us a bare minimum of information. Remember, when asking for help, the more information and detail you can give, the better.
Decima: The Last Story of Vald has a Facebook page and a development blog. Give them a look!
------------------------------
At 1/22/13 09:22 AM, Hoeloe wrote: what language you're writing this in.
At 1/18/13 02:46 PM, sekendis wrote: import java.util.Random;
Hmmm
At 1/22/13 09:22 AM, Hoeloe wrote: You know what would help?
Telling us what language you're writing this in. That's a fundamental thing we MUST know to be able to help.
You're also giving us a bare minimum of information. Remember, when asking for help, the more information and detail you can give, the better.
Actually, it's very clear that he/she is using Java. What would help is if he/she would put the source code in the code tags. You'll find more information about the code tag on the left of the message box.
At 1/18/13 02:46 PM, sekendis wrote: So, I've got this code, more like a script. It's a random generator for my role-plays. Got it all coded nice and neat runs perfectly....... In command line. How do I make this
You need to use a framework, I used to use swing, but it's deprecated as shit now. People recommend GWT instead of swing, not sure how it work or how easy/hard it is to setup and use, but you could also check that out I guess.
At 1/23/13 01:36 PM, kiwi-kiwi wrote:At 1/18/13 02:46 PM, sekendis wrote: So, I've got this code, more like a script. It's a random generator for my role-plays. Got it all coded nice and neat runs perfectly....... In command line. How do I make thisYou need to use a framework, I used to use swing, but it's deprecated as shit now. People recommend GWT instead of swing, not sure how it work or how easy/hard it is to setup and use, but you could also check that out I guess.
If swing is deprecated... why does GWT to use Swing (look at the components)?
https://developers.google.com/web-toolkit/tools/gwtdesigner/
userinterface/source_view
At 1/24/13 02:10 PM, VBAssassin wrote: If swing is deprecated... why does GWT to use Swing (look at the components)?
https://developers.google.com/web-toolkit/tools/gwtdesigner/
userinterface/source_view
Not sure, basically sometime ago java developers decided that SWING should belong in a dark corner where upgrades aren't necessary and was removed from netbeans to be superseded by something else sometime in the future (that was one year ago when I last used java for gui programming link here for a somewhat related discussion)
After snooping around for a while it seems that at the time oracle just released JavaFX 2.0 and was trying to push it as a replacement and I basically fell for the marketing.
@OP use whatever you want then I guess.
Still if you have the time I'd advise you to try out Qt before deciding what you want to pursue in the world of GUI programming.