/*********************** * * SlotDriver - class which creates a Slot object and runs it * until a jackpot (3 of a kind) is spun. * * Author: Shawn Brenneman * Date: 2015-Oct-21 * ***********************/ public class SlotDriver { public static void main(String[] args) { Slot machine = new Slot(); int count = 0; do { machine.spin(); System.out.println(machine); count++; if (machine.isPair()) System.out.println("Two of a Kind"); } while (!machine.isJackpot()); System.out.println("* * * J A C K P O T ! * * *"); System.out.println("\nIt took " + count + " spins to hit the jackpot.\n"); } //main }