can anybody see anything worng?

I'm returning these to the main

sO=ScoreO(O);
sX=ScoreX(X);

These are my two methods:

[java]
//method to tally the score for x
public static int ScoreX(boolean X){


int scoreX=0;


if(X==true){
scoreX+=1;
}
return scoreX;
}
//method to tally the score for x


public static int ScoreO(boolean O){


int scoreO=0;


if (O== true){
scoreO+=1;
}


return scoreO;
}



}
[/java]

What is wrong, because I can't figure it out...

Recommended Answers

All 2 Replies

It might help to know what you expect, and what you get, as well as any errors that are occurring. But, thing, if you are passing a boolean already then the == is redundant. Simply do

if (O) {

solved it, things for the help thought

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.