0

Hi i wanted to know how to implement a checking system so that whenever my program randomizes a horse it will always be unique. Thanks!

import java.util.Scanner;
public class Horses
{
    public static void main(String args[])
    {
      String[][] horses = {{"Black ","White ","Gray ","Old ","Young ",
                             "Pink ","Yellow ","Brown ","Orange ","Cyan ", 
                             "Purple ","Tan ","Cerulean ","Silver ","Gold ", 
                             "Red ","Green ","Blue ","Maroon ","Marigold ", 
                             "Iron ","Paper ","Wood ","Zinc ","Metal "},
                             {"Stallion"}
                           };
                           
      boolean check9 = false;  
      String[][] horsePlace = {{pickRand.get(horses[0]), pickRand.get(horses[0]), pickRand.get(horses[0])
                              , pickRand.get(horses[0]), pickRand.get(horses[0]), pickRand.get(horses[0])}};
                                               
      String[][] horsePlace2 = {{pickRand.get(horses[0]), pickRand.get(horses[0]), pickRand.get(horses[0])
                              , pickRand.get(horses[0]), pickRand.get(horses[0]), pickRand.get(horses[0])}}; 
                               
      String[][] horsePlace3 = {{pickRand.get(horses[0]), pickRand.get(horses[0]), pickRand.get(horses[0])
                              , pickRand.get(horses[0]), pickRand.get(horses[0]), pickRand.get(horses[0])}};     
                               
      String[][] horsePlace4 = {{pickRand.get(horses[0]), pickRand.get(horses[0]), pickRand.get(horses[0])
                              , pickRand.get(horses[0]), pickRand.get(horses[0]), pickRand.get(horses[0])}};     
                               
      String[][] horsePlace5 = {{pickRand.get(horses[0]), pickRand.get(horses[0]), pickRand.get(horses[0])
                              , pickRand.get(horses[0]), pickRand.get(horses[0]), pickRand.get(horses[0])}};     
     
 
      String[][] Placement = {{"1. "},
                           {"2. "},
                           {"3. "},
                           {"4. "},
                           {"5. "}};
                           
      String[][] heat1 = {{Placement[0][0] + horsePlace[0][0] + horses[1][0]},
                         {Placement[1][0] + horsePlace[0][1] + horses[1][0]},
                         {Placement[2][0] + horsePlace[0][2] + horses[1][0]},
                         {Placement[3][0] + horsePlace[0][3] + horses[1][0]},
                         {Placement[4][0] + horsePlace[0][4] + horses[1][0]}};
      
      
      String[][] heat2 = {{Placement[0][0] + horsePlace2[0][0] + horses[1][0]},
                         {Placement[1][0] + horsePlace2[0][1] + horses[1][0]},
                         {Placement[2][0] + horsePlace2[0][2] + horses[1][0]},
                         {Placement[3][0] + horsePlace2[0][3] + horses[1][0]},
                         {Placement[4][0] + horsePlace2[0][4] + horses[1][0]}};
                         
      String[][] heat3 = {{Placement[0][0] + horsePlace3[0][0] + horses[1][0]},
                         {Placement[1][0] + horsePlace3[0][1] + horses[1][0]},
                         {Placement[2][0] + horsePlace3[0][2] + horses[1][0]},
                         {Placement[3][0] + horsePlace3[0][3] + horses[1][0]},
                         {Placement[4][0] + horsePlace3[0][4] + horses[1][0]}};
                         
      String[][] heat4 = {{Placement[0][0] + horsePlace4[0][0] + horses[1][0]},
                         {Placement[1][0] + horsePlace4[0][1] + horses[1][0]},
                         {Placement[2][0] + horsePlace4[0][2] + horses[1][0]},
                         {Placement[3][0] + horsePlace4[0][3] + horses[1][0]},
                         {Placement[4][0] + horsePlace4[0][4] + horses[1][0]}};
                         
      String[][] heat5 = {{Placement[0][0] + horsePlace5[0][0] + horses[1][0]},
                         {Placement[1][0] + horsePlace5[0][1] + horses[1][0]},
                         {Placement[2][0] + horsePlace5[0][2] + horses[1][0]},
                         {Placement[3][0] + horsePlace5[0][3] + horses[1][0]},
                         {Placement[4][0] + horsePlace5[0][4] + horses[1][0]}};      
                         
      String[][] heat6 = {{Placement[0][0] + horsePlace[0][0] + horses[1][0]},
                          {Placement[1][0] + horsePlace2[0][0] + horses[1][0]},
                          {Placement[2][0] + horsePlace3[0][0] + horses[1][0]},
                          {Placement[3][0] + horsePlace4[0][0] + horses[1][0]},
                          {Placement[4][0] + horsePlace5[0][0] + horses[1][0]}};

      String[][] heat7 = {{Placement[0][0] + horsePlace[0][1] + horses[1][0]},
                         {Placement[1][0] + horsePlace[0][2] + horses[1][0]},
                         {Placement[2][0] + horsePlace2[0][0] + horses[1][0]},
                         {Placement[3][0] + horsePlace3[0][0] + horses[1][0]},
                         {Placement[4][0] + horsePlace2[0][1] + horses[1][0]}};
3
Contributors
2
Replies
3
Views
5 Years
Discussion Span
Last Post by peter_budo
0

since in your other thread, I gave you this as a suggestion, what have you tried so far?
and why did you start another thread? you could have asked issues about that in your other thread.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.