subject
Computers and Technology, 11.03.2021 14:00 IanMH

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: 1

Other questions on the subject: Computers and Technology

image
Computers and Technology, 23.06.2019 16:00, natasniebow
Kenny works with an it company. his company is about to launch new software in the market. he has to ensure that this new software is functional and meets all of the quality standards set up at the planning stage. which job profile is kenny likely to have? kenny is likely to have the job profile of a blank .
Answers: 2
image
Computers and Technology, 24.06.2019 01:00, cheycheybabygirl01
How can the temperature of a room be raised by 5degreesf?
Answers: 1
image
Computers and Technology, 24.06.2019 15:30, jhony70
What type of forensic evidence was recovered during the bomb set off at the new mexico facility on the video that was similar to the evidence obtained at the boston bombings and how did the evidence allow the researchers to connect other pieces of evidence to the same bomb?
Answers: 2
image
Computers and Technology, 24.06.2019 17:30, mariahdelossantos031
Which computer network component connects two different networks together and allows them to communicate? a is a node (or a device) that connects two different networks together and allows them to communicate.
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 pers...

Questions in other subjects:

Konu
History, 08.12.2020 21:50
Konu
History, 08.12.2020 21:50
Konu
English, 08.12.2020 21:50
Konu
Mathematics, 08.12.2020 21:50