package dojo.trivia.a20120505cr6.runner;
import java.util.Random;
import dojo.trivia.a20120505cr6.Game;
public class GameRunner {
private static boolean notAWinner;
public static void main(String[] args) {
play(new Random());
}
// reorder sequence
// extract method
public static void play(Random rand) {
Game aGame = new Game();
aGame.add("Chet");
aGame.add("Pat");
aGame.add("Sue");
do {
aGame.roll(rand.nextInt(5) + 1);
if (rand.nextInt(9) == 7) {
notAWinner = aGame.wrongAnswer();
} else {
notAWinner = aGame.wasCorrectlyAnswered();
}
} while (notAWinner);
}
}