Skip to content

Instantly share code, notes, and snippets.

@bartenbach
Created November 22, 2011 23:23
Show Gist options
  • Save bartenbach/1387399 to your computer and use it in GitHub Desktop.
Save bartenbach/1387399 to your computer and use it in GitHub Desktop.
public void scoreRound(){
System.out.println();
System.out.println("End of round scores:");
for(Team x: Teams){
TeamScore = x.getScore();
TeamName = x.getTeamName();
TeamBid = x.getTeamBid();
TeamBooks = x.getTeamBooks();
TeamOverBooks = x.getTeamOverBooks();
for(Player z : x.Team){
if(z.bidblindnil || z.bidnil){
this.nilbid = true;
if(nilbid){
Player teamMate = Position.getTeamMate(z);
if(z.bidblindnil){
if(z.getBooks() > 0){
x.TeamScore-=200;
int teamMateScore = calculateTeammate(teamMate);
x.TeamScore+=teamMateScore;
}else if(z.getBooks() == 0){
x.TeamScore+=200;
int teamMateScore = calculateTeammate(teamMate);
x.TeamScore+=teamMateScore;
}
}else if(z.bidnil){
if(z.getBooks() > 0){
x.TeamScore-=100;
int teamMateScore = calculateTeammate(teamMate);
x.TeamScore+=teamMateScore;
}else if(z.getBooks() == 0){
x.TeamScore+=100;
int teamMateScore = calculateTeammate(teamMate);
x.TeamScore+=teamMateScore;
}
}
}else{
if(TeamOverBooks > 0){
int temp = (TeamBid + TeamOverBooks) - TeamBid;
x.TeamScore+=(TeamBid*10)+ temp;
}else if(TeamBid == TeamBooks){
x.TeamScore+=x.TeamBid*10;
}else if(TeamBid > TeamBooks){
x.TeamScore+=x.TeamBid*-10;
}
}
}
}
System.out.println(TeamName + " Round Score: " + x.TeamScore);
x.TeamBooks = 0;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment