Game of War

1. Introduction

Your task is to make a modified game of the card game war. In essence there will be one deck that has card values stored in it. That deck will get delt out to the user and the computer so each have an even number of cards. When the battle button is clicked, the user and the pc will display their first cards. Whoever has the higher value on their card will get to keep both cards. If there is a tie between the user and the pc those cards will be taken out of the decks. Once one player has no more cards in their hands the game is over.

Here is an example of what your program should look like when it is complete:

Remember that a tie simply means those cards are taken out. It is not like the card game where you play back more cards. Also know that suit does not matter. We are just stroring point values from 1 - 13.

Part of this code uses a loop which we have not done yet. Please just remix this code to have the function of dealing out the cards done for you!

Remix

Make Sure You Use

Next
Back