Dear Sir M Zeeshan Ali
sir first of all im thankful to you for this great course and your way of teaching method is brilliant sir.
2nd sir im facing problem in "for loop". Toast me winner problem kar raha he ager winner red he tab bhi pehly red ko Winner show kar raha he or foran again Toast message me black (Yellow) ko bhi show kar raha he. winner koi bhi pehly red is winner show hota he then black is winner.
for(int[] winningPosition : winningLocations)
if (gameState[winningPosition[0]] == gameState[winningPosition[1]]
&& gameState[winningPosition[1]] == gameState[winningPosition[2]]
&& gameState[winningPosition[0]] != 2) {

if (activePlayer == 0) ; // is if per android studio error show kar raha he k empty hen statement.
Toast.makeText(getApplicationContext(), "x is winner", Toast.LENGTH_LONG).show();

if (activePlayer == 1) ;
Toast.makeText(getApplicationContext(), "y is winner", Toast.LENGTH_LONG).show();
gameOver = true;

2nd problem

gameOver = false;
activePlayer = 0;

for(int i = 0; i < gameState.length; i++); yaha jo hum integer "i" create kar rahy hen usy accept nahi kar raha android studio
gameState[i] = 2;

GridLayout gridLayout = (GridLayout) findViewById(R.id.gridLayout);
for(i = 0; i < gridLayout.getChildCount(); i++)
((ImageView) gridLayout.getChildAt(i)).setImageResource(0);

Quote 0 0
ap ny for loop or if condition k end man semicolon lagaya hy is liyee problem aarahi hy semicolon remove kar dy
Quote 1 0
Write a reply...