subject

The child’s game, War, consists of two players each having a deck of cards.  For each play, each person turns over the top card in his or her deck.  The higher card wins that round of play and the winner takes both cards.  The game continues until one person has all the cards and the other has none.  Create a program that simulates a modified game of War.   The computer will play both hands, as PlayerOne and PlayerTwo, and, for each round will generate two random numbers and compare them.  If the first number is higher, PlayerOne’s score is increased by 1 and if the second number is higher, PlayerTwo’s score is increased by 1.  If there is a tie, no score is incremented.  When one “player” reaches a score of 10, that player should be deemed the winner and the game ends.  The range of numbers should be 1-13 to simulate the values of cards in the deck.

ansver
Answers: 2

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 19:20
Terri needs to insert a cover page into her document. where should she go to access the commands to do so? o insert tab, objects group o insert tab, illustrations group o insert tab, pages group o insert tab, media group submit
Answers: 1
question
Computers and Technology, 23.06.2019 16:00
Helen is having a meeting with her colleagues in her company. they are working on the goals and objectives for the coming year. they want to ensure that these goals and objectives of the processes involved are properly evaluated. which system can helen and her colleagues apply to evaluate this? helen and her colleagues require a blank to evaluate the goals and objectives.
Answers: 2
question
Computers and Technology, 24.06.2019 02:00
How are we able to create photographs differently than 100 years ago? explain your answer in relation to your photograph you selected.
Answers: 1
question
Computers and Technology, 24.06.2019 03:30
Auniform resource locator (url) is a formatted string of text that web browsers, email applications, and other software programs use to identify a particular resource on the internet. true false
Answers: 2
You know the right answer?
The child’s game, War, consists of two players each having a deck of cards.  For each play, each per...
Questions
question
History, 31.03.2021 19:50
question
English, 31.03.2021 19:50
question
Mathematics, 31.03.2021 19:50
Questions on the website: 13722361