We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 953016e commit 176efa3Copy full SHA for 176efa3
1 file changed
ch13/War.java
@@ -71,6 +71,7 @@ public static void main(String[] args) {
71
}
72
73
74
+
75
System.out.println("size of p1: "+p1.size());
76
System.out.println("size of p2: "+p2.size());
77
System.out.println("size of warList: "+warList.size());
@@ -80,8 +81,10 @@ public static void main(String[] args) {
80
81
// display the winner
82
if (p2.isEmpty()) {
83
System.out.println("Player 1 wins!");
- } else {
84
+ } else if (p1.isEmpty()) {
85
System.out.println("Player 2 wins!");
86
+ } else {
87
+ System.out.println("TIE!");
88
89
90
0 commit comments