Sort and Scramble done, Game.java done (I think)

This commit is contained in:
blzimme000 2022-02-18 11:27:41 -06:00
parent cac5182b6a
commit c0a02db783

View file

@ -62,9 +62,9 @@ public class GameWheel
individual lists, then combine into big list similar to scramble method. individual lists, then combine into big list similar to scramble method.
*/ */
ArrayList<Slice> newSlices = new ArrayList<>(); ArrayList<Slice> newSlices = new ArrayList<>();
ArrayList<Slice> redStuff = new ArrayList<>(sort(colorSplit(slices, "red"))); ArrayList<Slice> redStuff = new ArrayList<>(privateSort(colorSplit(slices, "red")));
ArrayList<Slice> blueStuff = new ArrayList<>(sort(colorSplit(slices, "blue"))); ArrayList<Slice> blueStuff = new ArrayList<>(privateSort(colorSplit(slices, "blue")));
ArrayList<Slice> blackStuff = new ArrayList<>(sort(colorSplit(slices, "black"))); ArrayList<Slice> blackStuff = new ArrayList<>(privateSort(colorSplit(slices, "black")));
int blackCount = 0; int blackCount = 0;
int blueCount = 0; int blueCount = 0;
int redCount = 0; int redCount = 0;
@ -159,7 +159,7 @@ public class GameWheel
Collections.shuffle(list); Collections.shuffle(list);
return list; return list;
} }
private ArrayList<Slice> sort(ArrayList<Slice> list){ private ArrayList<Slice> privateSort(ArrayList<Slice> list){
for (int i = 1; i < list.size(); i++){ for (int i = 1; i < list.size(); i++){
Slice toInsert = new Slice("toInsert", list.get(i).getPrizeAmount()); Slice toInsert = new Slice("toInsert", list.get(i).getPrizeAmount());
int j; int j;