package solitaire;
class Main {
+ private static Stock stock = new Stock();
+ private static Waste waste = new Waste();
+
+ private static void printTable() {
+ System.out.printf("%s %s\n", stock, waste);
+ }
public static void main(String[] args) {
- Deck d = new Deck();
- System.out.println(d);
+ Card c;
+
+ while (!stock.isEmpty()) {
+ printTable();
- while (!d.isEmpty()) {
- Card c = d.draw();
+ c = stock.draw();
c.reveal();
- System.out.println(c);
+ waste.add(c);
}
- System.out.println(d);
+ printTable();
}
}