Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Javascript Help me Please!

Name: Berek 2010-07-01 7:48

How do I make this work in java?


Die1 = Random number 1-6
Die2 = Random number 1-6
Die3 = Random number 1-4

If Die1 = 6 AND Die2 = 6
then subtract (Die3 + 6) from 20 then send to field "x"

if Die1 = 1 AND Die2 = 1
then send 18 to field "x"

if Die1 > Die2
then subtract Die1 from 20 then send to field "x"

if Die1 < Die2
then subtract Die2 from 20 then send to field "x"

Name: Anonymous 2010-07-01 9:07

import java.util.Random

public static void main(String[] args) {
    int x;
    Random r = new Random();
    int d1 = r.nextInt(1,6), d2 = r.nextInt(1,6), d3 = r.nextInt(1,4);
    if(d1 == 6 && d2 == 6) x = 14 - d3;
    else if(d1 == 1 && d2 == 1) x = 18;
    else if(d1 > d2) x = 20 - d1;
    else if(d1 < d2) x = 20 - d2;
}

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List