Pls can anyone help me. I want to be able to select from 3 colors repeatedly awarding marks depending on color selected.I will have about 5 rounds of selection and in each round, I can select from the 3 available colors which come up randomly at various positions.
How to handle color selection in java
Collapse
X
-
Tags: None
-
Erm, I don't know whether or not I understand your question but for the randomOriginally posted by smallbrainPls can anyone help me. I want to be able to select from 3 colors repeatedly awarding marks depending on color selected.I will have about 5 rounds of selection and in each round, I can select from the 3 available colors which come up randomly at various positions.
stuff have a look at the Collections.shu ffle() method. For the association
of a Color with a mark, check out the Map interface and one of its
implementing classes: the HashMap. I think a:... would do fine.Code:Map<Color, Integer> markMap= new HashMap<Color, Integer>;
kind regards,
Jos
Comment