Last active
May 11, 2020 17:11
-
-
Save rahulkhatri19/2f6c2d4a29d7a1e3e8f703a213e41dda to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var Player1= ArrayList<Int>() | |
var Player2= ArrayList<Int>() | |
var ActivePlayer=1 | |
fun GameLogic(cellId:Int, btnSelected: Button){ | |
if (ActivePlayer == 1){ | |
btnSelected.text="X" | |
btnSelected.setBackgroundColor(Color.GRAY) | |
Player1.add(cellId) | |
ActivePlayer=2 | |
}else { | |
btnSelected.text="0" | |
btnSelected.setBackgroundColor(Color.BLUE) | |
Player2.add(cellId) | |
ActivePlayer=1 | |
} | |
btnSelected.isEnabled= false |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment