This is a problem to code a very simple game played by children called War.
You need two decks of cards that have been shuffled (randomized in order).
Each player has one deck.
Each player draws the top card from their deck of cards and shows it.
Honestly, feel free to mod the rules to any version of this you know or prefer. Develop a program which will simulate on the screen, the war game and keep up with the running score for the round as well as the match score. A match is the best of three games.
Biggest tips here:
Be careful about the ties, that is the hardest thing to code.
Ensure you reseed the randoms if you are allowing repeated play.
Already registered? Login
Not Account? Sign up
Enter your email address to reset your password
Back to Login? Click here