main.java
//Function to shuffle and return any int array
Function to shuffle and return any int array
Function to shuffle and return any int array
public static int[] shuffle(int[] shuffle){
        Random random= new Random();
        int length=shuffle.length;
        for(int x=length-1; x>0;x--){
            int index =random.nextInt(x+1);
            int hold = shuffle[index];
            shuffle[index]=shuffle[x];
            shuffle[x]=hold;
        }
        return shuffle;
    }
public static int [ ] shuffle ( int [ ] shuffle ) { Random random = new Random ( ) ; int length = shuffle . length ; for ( int x = length - 1 ; x > 0 ; x -- ) { int index = random . nextInt ( x + 1 ) ; int hold = shuffle [ index ] ; shuffle [ index ] = shuffle [ x ] ; shuffle [ x ] = hold ; } return shuffle ; }
Function to shuffle and return any int array
Function to shuffle and return any int array
//getting length //loop for length in reverse //generate random indexes //Swap