Ejemplo n.º 1
0
 // assignVals() -- assigns random values to all but specified # of vars
 //                populates vars with random Doubles
 public void assignVals(int lo, int hi, int pow, int difficulty) {
   shuffle();
   for (int i = difficulty; i < varList.size(); i++) {
     vars.put(varList.get(i), randomNum(lo, hi, pow));
   }
   addKeys();
 }
Ejemplo n.º 2
0
 // assignVals() -- assigns random values to all but one varible
 //               populates HashMap
 public void assignVals(int lo, int hi, int pow) {
   shuffle();
   for (int i = 1; i < varList.size(); i++) {
     vars.put(varList.get(i), randomNum(lo, hi, pow));
   }
   vars.put(varList.get(0), null);
 }