Limited Offer Get 25% off — use code BESTW25
No AI No Plagiarism On-Time Delivery Free Revisions
Claim Now
Prices start at $5 per page · plagiarism-free papers · free revisions for 14 days 24/7 support: support@bestwriters.com
Uncategorized

MARIE program to implement one round

  • Posted
  • Authoradmin
  • Length283 words
  • Reading time2 min
Write My Assignment FREE

Write a MARIE program to implement one round of rock paper scissors game. Your program should represent the three moves ‘rock’, ‘paper’ and ‘scissors’ with numbers 1, 2 and 3 respectively. When the program is run, there should be two input prompts, one after the other, to ask for player 1’s and player 2’s moves (a number 1, 2 or 3). Then the program would compare both numbers and apply the following rules to work out the winner.

  • Paper beats rock, scissors beat paper and rock beats scissors.
  • If both moves are same, round is drawn.

Depending on the results of comparison there will be one of the three outputs: ‘P1 Won’ or ‘P2 Won’ or ‘Draw’. Once a result is obtained, the program would take a third input from user to ask if they want to repeat with another round. User should enter a number 1 to indicate ‘yes’ and that should repeat the whole process. Any input other than 1 should be treated as ‘no’ and quit the program.

Use ‘decimal’ mode for inputs and ‘Unicode’ mode for outputs. To display text on output, you need to print it character by character using their ASCII codes. Insert a line break (ASCII code 10) before starting next round. Assume that the user will always provide valid numbers as input — do not worry about dealing with invalid input data. Also write comments within your program so that a reader can understand it easily.

Use the online MARE simulator at this link: https://marie.js.org/

The post MARIE program to implement one round appeared first on My Assignment Online.

Plagiarism Free Assignment Help

Expert Help With This Assignment — On Your Terms

✓ Native UK, USA & Australia writers ✓ Deadline from 3 hours ✓ 100% Plagiarism-Free — Turnitin included ✓ Unlimited free revisions ✓ Free to submit — compare quotes

admin

Academic writer and editor at BestWriters.

Get your paper off your plate tonight

Post your instructions for free. Prices start at $5 per page.

Place an order