Here you can find the source of flipInPlace(int[][] theArray)
Parameter | Description |
---|---|
theArray | the original block content as matrix |
public static int[][] flipInPlace(int[][] theArray)
//package com.java2s; //License from project: Open Source License public class Main { /**/*from w ww.j a v a 2 s . co m*/ * returns the flipping of entire block/piece * @param theArray the original block content as matrix * @return */ public static int[][] flipInPlace(int[][] theArray) { for (int i = 0; i < (theArray.length / 2); i++) { int[] temp = theArray[i]; theArray[i] = theArray[theArray.length - i - 1]; theArray[theArray.length - i - 1] = temp; } return theArray; } }