Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Random r = new Random();
- int Low = 10;
- int High = 100;
- //int R = r.nextInt(High-Low) + Low;
- //Now on to history:
- //Best:
- tempJson = historyWeeks.getJSONObject("best");
- tempJsonArr = tempJson.getJSONArray("steps");
- int[] bestSteps = new int[7];
- for (int i = 0; i < 7; i++) {
- //bestSteps[i] = tempJsonArr.getInt(i);
- bestSteps[i] = r.nextInt(High-Low) + Low;
- }
- tempJsonArr = tempJson.getJSONArray("onfoot");
- int[] bestOnFoot = new int[tempJsonArr.length()];
- for (int i = 0; i < tempJsonArr.length(); i++) {
- bestOnFoot[i] = tempJsonArr.getInt(i);
- }
- tempJsonArr = tempJson.getJSONArray("breaks");
- int[] bestBreaks = new int[tempJsonArr.length()];
- for (int i = 0; i < tempJsonArr.length(); i++) {
- bestBreaks[i] = tempJsonArr.getInt(i);
- }
- //Previous:
- tempJson = historyWeeks.getJSONObject("previous");
- tempJsonArr = tempJson.getJSONArray("steps");
- int[] previousWeekSteps = new int[7];
- for (int i = 0; i < 7; i++) {
- //previousWeekSteps[i] = tempJsonArr.getInt(i);
- previousWeekSteps[i] = r.nextInt(High-Low) + Low;
- }
- tempJsonArr = tempJson.getJSONArray("onfoot");
- int[] previousWeekOnFoot = new int[tempJsonArr.length()];
- for (int i = 0; i < tempJsonArr.length(); i++) {
- previousWeekOnFoot[i] = tempJsonArr.getInt(i);
- }
- tempJsonArr = tempJson.getJSONArray("breaks");
- int[] previousWeekBreaks = new int[tempJsonArr.length()];
- for (int i = 0; i < tempJsonArr.length(); i++) {
- previousWeekBreaks[i] = tempJsonArr.getInt(i);
- }
- //Current:
- tempJson = historyWeeks.getJSONObject("current");
- tempJsonArr = tempJson.getJSONArray("steps");
- int[] currentWeekSteps = new int[7];
- for (int i = 0; i < 7; i++) {
- //currentWeekSteps[i] = tempJsonArr.getInt(i);
- currentWeekSteps[i] = r.nextInt(High-Low) + Low;
- }
- tempJsonArr = tempJson.getJSONArray("onfoot");
- int[] currentWeekOnFoot = new int[tempJsonArr.length()];
- for (int i = 0; i < tempJsonArr.length(); i++) {
- currentWeekOnFoot[i] = tempJsonArr.getInt(i);
- }
- tempJsonArr = tempJson.getJSONArray("breaks");
- int[] currentWeekBreak = new int[tempJsonArr.length()];
- for (int i = 0; i < tempJsonArr.length(); i++) {
- currentWeekBreak[i] = tempJsonArr.getInt(i);
- }
Advertisement
Add Comment
Please, Sign In to add comment