I need a variable to stick. Permenantly.

Sorry If this post looks like another that may have or may not have gone through. I don't know whether the other one posted. N-e-wayz, I need a variable to permanantly stay incremented after I run the program. Why ? Becuase I need to run through some strings one at a time. Thanks in advance.

[300 byte] By [i-8-a-pir8a] at [2007-11-27 11:44:17]
# 1

package ProjBeta1;

public class Main {

public static void main(String[] args) {

int rnumber = x;

String[] JoJok1={"Joe moma's so giant she walked outside with an x-files shirt on and a helicopter landed on her.",

"Joe momma's so fat she turned around on her birthday and it was her next birthday.",

"Joe momma's so massive she has her own gravitational pull and has now replaced pluto as the nineth planet.",

"Joe momma's so poor she doesn't fly southwest airlines she flies via UPS first class (in the cargo bay)",

"Joe momma's so huge she doesn't have cornrows, she has crop circles",

"Joe momma's so big she did a backflip on the trampoline and kicked Jesus in the face",

"Joe momma's so ugly she walked by you with a muddy pig in her arms and you asked her where she got it and it said, I got her at an auction house!"

};

System.out.println(" " + JoJok1[rnumber] + " ");

x = x + 1;

if(x == 6) {

x = 0;

}

}

}

This is what I have so far. It's not very impressive in any way shape or form I know. However I could really use some help.

i-8-a-pir8a at 2007-7-29 17:54:50 > top of Java-index,Java Essentials,New To Java...
# 2

it's said of Smokin' Joe Frazier, then when he hit someone, they stayed hit.

You, on the other hand need to use some kind of persistence.

BigDaddyLoveHandlesa at 2007-7-29 17:54:50 > top of Java-index,Java Essentials,New To Java...
# 3

I have no idea what it is you want.

prometheuzza at 2007-7-29 17:54:50 > top of Java-index,Java Essentials,New To Java...
# 4

Are you saying I haven't been trying for the past 3 and a half hours trying to get one measly problem solved three differen't ways, and this way looks the most plausible ?

i-8-a-pir8a at 2007-7-29 17:54:50 > top of Java-index,Java Essentials,New To Java...
# 5

She so po' she can't afford to have an opinion.

BigDaddyLoveHandlesa at 2007-7-29 17:54:50 > top of Java-index,Java Essentials,New To Java...
# 6

I want to get a variable to stay when I run this code. This way I only print one string at a time...

i-8-a-pir8a at 2007-7-29 17:54:50 > top of Java-index,Java Essentials,New To Java...
# 7

Uggghhhh I think I'm just retarded... I can't get my message across!

i-8-a-pir8a at 2007-7-29 17:54:50 > top of Java-index,Java Essentials,New To Java...
# 8

Rather than do that, why not randomly choose one of the strings and print that?

With enough strings, it's unlikely you will print the same one twice in a row.

BigDaddyLoveHandlesa at 2007-7-29 17:54:50 > top of Java-index,Java Essentials,New To Java...
# 9

> Are you saying I haven't been trying for the past 3

> and a half hours trying to get one measly problem

> solved three differen't ways, and this way looks the

> most plausible ?

Do you want to solve your problem? Then explain what it is you're trying to do instead of going into defense.

prometheuzza at 2007-7-29 17:54:50 > top of Java-index,Java Essentials,New To Java...
# 10

Because If I use the random class then I will not be able to port it to phones.

i-8-a-pir8a at 2007-7-29 17:54:50 > top of Java-index,Java Essentials,New To Java...
# 11

I made the whole program work perfectly but it wouldn't port to phones because of the random class and the fact that it wasn't in there.

i-8-a-pir8a at 2007-7-29 17:54:50 > top of Java-index,Java Essentials,New To Java...
# 12

Oh yeah, and what I said earlier was not to you promiethuzz I was annoyed by the first person who spoke and typed too slow.

i-8-a-pir8a at 2007-7-29 17:54:50 > top of Java-index,Java Essentials,New To Java...
# 13

> Because If I use the random class then I will not be

> able to port it to phones.

Really? If need be, you can google and find pseudo-random number generator code in less time than it takes to say a "yo' momma" joke.

BigDaddyLoveHandlesa at 2007-7-29 17:54:50 > top of Java-index,Java Essentials,New To Java...
# 14

Sorry, man.

i-8-a-pir8a at 2007-7-29 17:54:50 > top of Java-index,Java Essentials,New To Java...
# 15

Oh wow. Wish I had known that earlier, how does that work ?

i-8-a-pir8a at 2007-7-29 17:54:55 > top of Java-index,Java Essentials,New To Java...
# 16

> Oh wow. Wish I had known that earlier, how does that work ?

What, Google?

BigDaddyLoveHandlesa at 2007-7-29 17:54:55 > top of Java-index,Java Essentials,New To Java...
# 17

No adding thier random generator to my program. Oh and I can't find one can you give me an exact site ?

i-8-a-pir8a at 2007-7-29 17:54:55 > top of Java-index,Java Essentials,New To Java...
# 18

> Oh yeah, and what I said earlier was not to you

> promiethuzz I was annoyed by the first person who

> spoke and typed too slow.

I knew that, but my reply still stands.

Anyway, if you're looking for a (pseudo) random number generator, search the web for "Linear Congruential Method", which will result in many useful documentation how to implement your own (pseudo) random number generator.

Post back if you have specific questions about your implementation.

prometheuzza at 2007-7-29 17:54:55 > top of Java-index,Java Essentials,New To Java...
# 19

The Mersenne Twister is quite good:

http://en.wikipedia.org/wiki/Mersenne_twister

BigDaddyLoveHandlesa at 2007-7-29 17:54:55 > top of Java-index,Java Essentials,New To Java...
# 20

> The Mersenne Twister is quite good

I thought that was a party game played at the French court in the 17th century.

DrClapa at 2007-7-29 17:54:55 > top of Java-index,Java Essentials,New To Java...
# 21

> > The Mersenne Twister is quite good

>

> I thought that was a party game played at the French

> court in the 17th century.

A hooker once said she'd give me a Mersenne Twister for $100.

BigDaddyLoveHandlesa at 2007-7-29 17:54:55 > top of Java-index,Java Essentials,New To Java...
# 22

> ...

> A hooker once said she'd give me a Mersenne Twister

> for $100.

That's a bit too much for a hooker from the 17th century!

prometheuzza at 2007-7-29 17:54:55 > top of Java-index,Java Essentials,New To Java...
# 23

> > ...

> > A hooker once said she'd give me a Mersenne

> Twister

> > for $100.

>

> That's a bit too much for a hooker from the 17th

> century!

Oh, I was converting from florins and taking inflation into account.

BigDaddyLoveHandlesa at 2007-7-29 17:54:55 > top of Java-index,Java Essentials,New To Java...
# 24

> Oh, I was converting from florins and taking

> inflation into account.

Ah, I see.

prometheuzza at 2007-7-29 17:54:55 > top of Java-index,Java Essentials,New To Java...
# 25

> > Oh, I was converting from florins and taking

> > inflation into account.

>

> Ah, I see.

Not that I took her up on it. I've never paid for a piece of *** in my life. And she offered to take her false teeth out first, too.

BigDaddyLoveHandlesa at 2007-7-29 17:54:55 > top of Java-index,Java Essentials,New To Java...
# 26

> > That's a bit too much for a hooker from the 17th

> > century!

>

> Oh, I was converting from florins and taking

> inflation into account.

So that's, let's see... 1.87 German florins. Or was that the Italian florin you meant?

DrClapa at 2007-7-29 17:54:55 > top of Java-index,Java Essentials,New To Java...
# 27

> Not that I took her up on it. I've never paid for a

> piece of *** in my life. And she offered to take her

> false teeth out first, too.

Lemme guess: you were running late for diner, right?

prometheuzza at 2007-7-29 17:54:55 > top of Java-index,Java Essentials,New To Java...
# 28

Ahem. I think we all need to get back to work.

BigDaddyLoveHandlesa at 2007-7-29 17:54:55 > top of Java-index,Java Essentials,New To Java...