Search
 
SCRIPT & CODE EXAMPLE
 

JAVA

2048 java code

private void verticalMove( int row, int col, String direction )
    {
        Tile initial = board[border][col];
        Tile compare = board[row][col];
        if ( initial.getValue() == 0 || initial.getValue() == compare.getValue() )
        {
            if ( row > border || ( direction.equals( "down" ) && ( row < border ) ) )
            {
                int addScore = initial.getValue() + compare.getValue();
                if ( initial.getValue() != 0 )
                {
                    score += addScore;
                }
                initial.setValue( addScore );
                compare.setValue( 0 );
            }
        }
        else
        {
            if ( direction.equals( "down" ) )
            {
                border--;
            }
            else
            {
                border++;
            }
            verticalMove( row, col, direction );
        }
    }
Comment

PREVIOUS NEXT
Code Example
Java :: jda documentation discord 
Java :: intersection of two arrays java 
Java :: command to create a Hashmap in Java 
Java :: 1 elemenet array java 
Java :: how to find mongo java driver version 
Java :: get field name java 
Java :: java developer interview questions 
Java :: java.lang.classcastexception: java.lang.string cannot be cast to java.util.arraylist 
Java :: getstring java 
Java :: string vs new string 
Java :: the import junit cannot be resolved maven 
Java :: java complex numbers 
Java :: java list change element position 
Java :: how to sort a list in java 
Java :: java garbage collection 
Java :: Java Expression statements 
Java :: unresolved reference activity_main 
Java :: stream reduce 
Java :: merge sort recursion java 
Java :: class property java 
Java :: Java Exception handling using try...catch 
Java :: Java forEach() Method 
Java :: nested class in java 8 
Java :: kafkalistener annotation pass topic from properties file 
Java :: update a key in the firebase realtime database java 
Java :: preset arraylist java 
Java :: show bottom sheet in adapter 
Java :: English print format number in java 
Java :: how to accept only numbers and whitespace in java 
Java :: add external JARs to java vscode 
ADD CONTENT
Topic
Content
Source link
Name
5+9 =