Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static void createScrimmage() {
- float[] team1 = new float[15];
- float[] team2 = new float[15];
- float[] team3 = new float[15];
- String[] team1Player = new String[15];
- String[] team2Player = new String[15];
- String[] team3Player = new String[15];
- float[] attackStats = new float[aStats.size()];
- String[] addPlayers = new String[players.size()];
- for(int x = 0; x < attackStats.length; x++) {
- attackStats[x] = aStats.get(x);
- addPlayers[x] = players.get(x);
- }
- int n = attackStats.length;
- for(int i = 0; i < n-1; i++) {
- for(int j = 0; j < n-i-1; j++) {
- if(attackStats[j] < attackStats[j+1]) {
- float temp = attackStats[j];
- String temp2 = addPlayers[j];
- attackStats[j] = attackStats[j+1];
- attackStats[j+1] = temp;
- addPlayers[j] = addPlayers[j+1];
- addPlayers[j+1] = temp2;
- }
- }
- }
- if(count/2 < 9) {
- int y = 0;
- int z = 1;
- for(int x = 0; x < 6; x++) {
- team1[x] = attackStats[y];
- team2[x] = attackStats[z];
- team1Player[x] = addPlayers[y];
- team2Player[x] = addPlayers[z];
- y = y + 2;
- z = z + 2;
- }
- System.out.println("Team 1");
- for(int x = 0; x < 6; x++) {
- System.out.println(team1Player[x] + " " + team1[x]);
- }
- System.out.println("\nTeam 2");
- for(int x = 0; x < 6; x++) {
- System.out.println(team2Player[x] + " " + team2[x]);
- }
- } else if (count / 2 >= 9) {
- int x = 0;
- int y = 1;
- int z = 2;
- for (int i = 0; i < 6; i++) {
- team1[i] = attackStats[x];
- team2[i] = attackStats[y];
- team3[i] = attackStats[z];
- team1Player[i] = addPlayers[x];
- team2Player[i] = addPlayers[y];
- team3Player[i] = addPlayers[z];
- x = x + 3;
- y = y + 3;
- z = z + 3;
- }
- System.out.println("Team 1");
- for (int i = 0; i < 6; i++) {
- System.out.println(team1Player[i]);
- }
- System.out.println("\nTeam 2");
- for (int i = 0; i < 6; i++) {
- System.out.println(team2Player[i]);
- }
- System.out.println("\nTeam 3");
- for (int i = 0; i < 6; i++) {
- System.out.println(team3Player[i]);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement