import java.util.ArrayList; import java.util.List; public class Casino { public static void main(String[] args) { List wallet = new ArrayList(); wallet.add(Coin.getInstance()); final int TRIES = 10; int tries = 0; while (tries < TRIES && !wallet.isEmpty()) { Coin coin = wallet.remove(0); List winnings = OneArmedBandit.pull(coin); wallet.addAll(winnings); tries++; } System.out.printf("You started with one coin and after %d tries ended with %d coins%n", tries, wallet.size()); } }