0

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...

Edited by happygeek: fixed formatting

2
Contributors
2
Replies
3
Views
9 Years
Discussion Span
Last Post by Dio1080
0

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) {
This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.