War card game: Difference between revisions

Content added Content deleted
(New post.)
m (Corrected minor error in code.)
Line 568: Line 568:
System.out.println("The game ended in a tie");
System.out.println("The game ended in a tie");
} else if ( handA.size() == 0 ) {
} else if ( handA.size() == 0 ) {
System.out.println("Player A has won the game");
System.out.println("Player B has won the game");
} else {
} else {
System.out.println("Player B has won the game");
System.out.println("Player A has won the game");
}
}
}
}
Line 622: Line 622:
? ? Cards are face down
? ? Cards are face down
2S 2H War!
2S 2H War!
Player A has won the game
Player B has won the game
</pre>
</pre>