/** * Elimination score */ private int plusExp() { // Get map information boolean[][] gameMap =
this.gameDto.getGameMap(); // Initialize the number of elimination lines int lineNum=0; // Scan the map , Judge whether the line can be cancelled for(int
y=0;y<gameMap.length;y++){ if(this.isCanRemoveLine(y, gameMap)){ // Cancelling operation
this.removeLine(y,gameMap); // Increase the number of elimination lines lineNum++; } } return lineNum; } /** * Cancelling operation
*/ private void removeLine(int rowNumber,boolean[][] gameMap){ for(int
x=0;x<GameConfig.getSystemConfig().getMaxX();x++){ for(int
y=rowNumber;y>0;y--){ gameMap[y][x]=gameMap[y-1][x]; } // The first 0 Set row to false
gameMap[0][x]=false; } } /** * Judge whether the line can be cancelled */ private boolean isCanRemoveLine(int
y,boolean[][] gameMap) { for(int
x=0;x<GameConfig.getSystemConfig().getMaxX();x++){ // As long as there is an empty line (false), It's not necessary
if(!gameMap[y][x]){ return false; } } return true; }
 

Technology
©2019-2020 Toolsou All rights reserved,
Python Garbage collection and memory leak hive Summary of processing methods for a large number of small files The difference between memory overflow and memory leak , Causes and Solutions Create data mysql Library process You don't know ——HarmonyOS stay Vue Use in Web WorkerSparkSQL Achieve partition overlay write msf Generate Trojan horse attack android mobile phone Linux Page replacement algorithm C Language implementation Django Personal blog building tutorial --- Time classified archiving