• ibrahim
  • Junior Member
  • Posts 2
  • Reputation 0
  • Member Since
  • Last Active
All Posts Topics Started Likes
Tic Tac Toe Check it out any things is wrong in it or not Sir
MashaALLAH IrfanAhmed brother... 
even mujhy 1 solution mil gaya ap ki coding se... thanks jazak ALLAH
0 0
facing problem in java coding
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);







0 0
count post selected

Add a Website Forum to your website.