d2jsp
Log InRegister
d2jsp Forums > Off-Topic > Computers & IT > Programming & Development > Java Question ~~ Arrays / Txt Files
Prev12
Add Reply New Topic New Poll
Member
Posts: 534
Joined: Feb 8 2011
Gold: 53.30
Feb 22 2013 05:11pm
Quote (labatymo @ Feb 22 2013 05:08pm)
In your origional code, you were storing the list into an array called records, but looking at your full code, you're just using the list. So replace the System.out.println(records[new Random().nextInt( records.length )]) line with this...
System.out.println(winninglist.get(new Random().nextInt( winninglist.size())));


I do that, but it says. "winninglist cannot be resolved.
/e Im placing the println you wrote after the userCash = userCash + .50;
Your code here--- Because I need to display this msg after they win.

This post was edited by Malexir on Feb 22 2013 05:13pm
Member
Posts: 534
Joined: Feb 8 2011
Gold: 53.30
Feb 22 2013 05:23pm
I figured out the problem.... I had to move the catch statement to the bottom, so that the array list and whatnot stuff up top included the for loop and its 100 + lines...

So my next issue I suppose is to do the same thing but for losing messages.. Do I just copy / paste and rename for losing?
Member
Posts: 2,757
Joined: Nov 26 2007
Gold: 1,214.81
Feb 22 2013 05:25pm
yea, just copy and paste it
Go Back To Programming & Development Topic List
Prev12
Add Reply New Topic New Poll