• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Jeanne Boyarsky
  • Junilu Lacar
  • Henry Wong
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Frits Walraven
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • salvin francis
  • fred rosenberger

10 shuffling question

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am new to java, can anyone help me out?
I use random method, sometime same question appear on the applet.
Try using shuffling method but don't know how to do.

(Marilyn added code tags)
[ January 01, 2004: Message edited by: Marilyn de Queiroz ]
 
Ranch Hand
Posts: 7729
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If your problem boils down to permuting a list of strings then I suggest that you take a look at java.util.Collections. There is a shuffle method that does just that. You will also find java.util.Arrays useful to get yourself a List to shuffle.
[ January 02, 2004: Message edited by: Barry Gaunt ]
 
Sheriff
Posts: 9099
12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Originally posted by pt wee:
I use random method, sometime same question appear on the applet.
Try using shuffling method but don't know how to do.



Random will be random, sometimes the same question will appear more than once. You may need to "delete" those questions after they are "used" to prevent them from reappearing, or flag them as "used".
 
I would challenge you to a battle of wits, but I see you are unarmed - shakespear. Unarmed tiny ad:
Devious Experiments for a Truly Passive Greenhouse!
https://www.kickstarter.com/projects/paulwheaton/greenhouse-1
    Bookmark Topic Watch Topic
  • New Topic