Skip to content

Commit

Permalink
Changes to Game
Browse files Browse the repository at this point in the history
  • Loading branch information
13howardD committed Apr 27, 2015
1 parent 0728be4 commit 716c014
Showing 1 changed file with 20 additions and 7 deletions.
27 changes: 20 additions & 7 deletions src/Game.java
Original file line number Diff line number Diff line change
Expand Up @@ -34,26 +34,39 @@ public int numCards(){
public void playRound(){
if (d.hasNext() == true && t.numSets() == 0){
for (int i = 0; i < 3; i++){
if (d.hasNext() == false)
if (d.hasNext()){
t.add(d.getNext());
}
else{
return;
}
}
}

else if (d.hasNext() == true && t.numSets() != 0){
if (d.hasNext() && t.numSets() != 0){
for (int x = 0; x < t.numCards() - 2; x++){
for (int y = x + 1; y < t.numCards() - 1; y++){
for (int z = y + 1; z < t.numCards(); z++){
if (t.getCard(x).isSet(t.getCard(y), t.getCard(z))){
t.removeSet(t.getCard(x), t.getCard(y), t.getCard(z));
return;

if (t.numCards() < 12 && d.hasNext()) {
for (int o = 0; o < 3; o++) {
if (d.hasNext()) {
t.add(d.getNext());
}
else {
return;
}
}
}
return;
}
}
}
}
return;
}
}
}
}
}

public boolean isGameOver(){
if (d.hasNext() == false && t.numSets() == 0){
Expand Down

0 comments on commit 716c014

Please sign in to comment.