Game of War

4. Game Over

In this section you will come up with the gameOver function. This function should check to see if the game is over, and hide the battle button from the user if it is. Quite a simple function it just needs to check and see if either the user or the pc are out of cards. If one or both of them have no cards left, then use the hideElement block to hide the battle button. This function does not need any parameters, nor should it return anything.

From this point forward you cannot add any more global variables. The only global variables you should have are deck, userHand, pcHand, and the variable len which was already built.