Is there a way to set the range for a random number generator and restrict one of the numbers within that range?

From ggc

Jump to: navigation, search

For instance if my range was 1-6 but i wanted to exclude 4, would i need to add something else onto the line?

   x=random.nextInt(5)+1...?;




Views
Personal tools
Add to 
del.icio.usAdd to 
diggAdd to 
FacebookAdd to 
favoritesAdd to 
GoogleAdd to 
MySpaceAdd to 
PrintAdd to 
SlashdotAdd to 
StumbleUponAdd to 
Twitter