Java Array Flip flipChessboardVertically(int[] chessboard)

Here you can find the source of flipChessboardVertically(int[] chessboard)

Description

flip Chessboard Vertically

License

Open Source License

Declaration

public static int[] flipChessboardVertically(int[] chessboard) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

public class Main {
    public static int[] flipChessboardVertically(int[] chessboard) {
        int len = chessboard.length;

        int[] newChessboard = new int[len];
        for (int i = 0; i < len; i++) {
            newChessboard[i] = chessboard[len - 1 - i];
        }//from www.j  a  va2  s .  co  m
        return newChessboard;
    }
}

Related

  1. flip(String[][] data)
  2. flip(T[] array)
  3. flipAllBits(byte[] bytes)
  4. flipAllBitsInPlace(byte[] bytes)