public void checkWinner(){
int sel = r.nextInt(players.length);
players[sel].setStatus(Player.Status.OUT);
while(players.length==1 && players[i].getStatus==Player.Status.IN){
System.out.println("\nThis is how we stand...");
for(int i=0;i<players.length;i++){
System.out.println(players[i].getName()+" is "+players[i].getStatus());
} break;
}
}
public void checkWinner(){
int sel = r.nextInt(players.length);
players[sel].setStatus(Player.Status.OUT);
while(players.length==1 && players[i].getStatus==Player.Status.IN){
System.out.println("\nThis is how we stand...");
for(int i=0;i<players.length;i++){
System.out.println(players[i].getName()+" is "+players[i].getStatus());
} break;
}
}
I am wondering what i am doing wrong. I am trying to have a while loop inside the for-looop that only continues until one of the players have a status of in
public void checkWinner(){
int sel = r.nextInt(players.length);
players[sel].setStatus(Player.Status.OUT);
while(players.length==1 && players[i].getStatus==Player.Status.IN){
System.out.println("\nThis is how we stand...");
for(int i=0;i<players.length;i++){
System.out.println(players[i].getName()+" is "+players[i].getStatus());
} break;
}
}
Sorry about not using the correct code tags

New Topic/Question
Reply



MultiQuote




|