Advertisement
Guest User

Untitled

a guest
Apr 22nd, 2019
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 2.09 KB | None | 0 0
  1.     public static void createScrimmage() {
  2.         float[] team1 = new float[15];
  3.         float[] team2 = new float[15];
  4.         float[] team3 = new float[15];
  5.         String[] team1Player = new String[15];
  6.         String[] team2Player = new String[15];
  7.         String[] team3Player = new String[15];
  8.         float[] attackStats = new float[aStats.size()];
  9.         String[] addPlayers = new String[players.size()];
  10.         for(int x = 0; x < attackStats.length; x++) {
  11.             attackStats[x] = aStats.get(x);
  12.             addPlayers[x] = players.get(x);
  13.         }
  14.         int n = attackStats.length;
  15.         for(int i = 0; i < n-1; i++) {
  16.             for(int j = 0; j < n-i-1; j++) {
  17.                 if(attackStats[j] < attackStats[j+1]) {
  18.                     float temp = attackStats[j];
  19.                     String temp2 = addPlayers[j];
  20.                     attackStats[j] = attackStats[j+1];
  21.                     attackStats[j+1] = temp;
  22.                     addPlayers[j] = addPlayers[j+1];
  23.                     addPlayers[j+1] = temp2;
  24.                 }
  25.             }
  26.         }
  27.         if(count/2 < 9) {
  28.             int y = 0;
  29.             int z = 1;
  30.             for(int x = 0; x < 6; x++) {
  31.                 team1[x] = attackStats[y];
  32.                 team2[x] = attackStats[z];
  33.                 team1Player[x] = addPlayers[y];
  34.                 team2Player[x] = addPlayers[z];
  35.                 y = y + 2;
  36.                 z = z + 2;
  37.             }
  38.             System.out.println("Team 1");
  39.             for(int x = 0; x < 6; x++) {
  40.                 System.out.println(team1Player[x] + " " + team1[x]);
  41.             }
  42.             System.out.println("\nTeam 2");
  43.             for(int x = 0; x < 6; x++) {
  44.                 System.out.println(team2Player[x] + " " + team2[x]);
  45.             }  
  46.         } else if (count / 2 >= 9) {
  47.             int x = 0;
  48.             int y = 1;
  49.             int z = 2;
  50.             for (int i = 0; i < 6; i++) {
  51.                 team1[i] = attackStats[x];
  52.                 team2[i] = attackStats[y];
  53.                 team3[i] = attackStats[z];
  54.                 team1Player[i] = addPlayers[x];
  55.                 team2Player[i] = addPlayers[y];
  56.                 team3Player[i] = addPlayers[z];
  57.                 x = x + 3;
  58.                 y = y + 3;
  59.                 z = z + 3;
  60.             }
  61.             System.out.println("Team 1");
  62.             for (int i = 0; i < 6; i++) {
  63.                 System.out.println(team1Player[i]);
  64.             }
  65.             System.out.println("\nTeam 2");
  66.             for (int i = 0; i < 6; i++) {
  67.                 System.out.println(team2Player[i]);
  68.             }
  69.             System.out.println("\nTeam 3");
  70.             for (int i = 0; i < 6; i++) {
  71.                 System.out.println(team3Player[i]);
  72.             }
  73.         }
  74.        
  75.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement