collect a head before any eyes, mouth or horn can be added. ode, it is worth playing this game a few times using a pencil, paper and an https://rolladie.net/roll-a-d8-die). Choose whether you are going to build a Fore you begin. s game as one Python function. The function should have one parameter o select whether a Unicorn or a Pegasus is built. Follow the steps and logic hysical game. Your code should include enough print statements to generate ial example illustrating a play of the game, telling the story as the dice is rolled re's body parts are assembled. Explain carefully what steps you have taken to (not just debugging). Please provide both your code and the output from one each of Unicorn and Pegasus. [15 marks] thon code to add at least three counts that effectively summarise a game, y dice rolls are made. Use these summary counts to compare building a uilding a Pegasus. Also implement a variant in which the player builds one orn and one complete Pegasus in parallel (while carefully satisfying the body parts for both creatures), and compare the resulting counts with those game (making some relevant conclusions). Please provide separate Python iginal game with counts and the variant, together with output from sample nd a comparison of counts in a table for the Unicorn-only, Pegasus-only and -I versions. (10 marks)

C++ for Engineers and Scientists
4th Edition
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Bronson, Gary J.
Chapter4: Selection Structures
Section: Chapter Questions
Problem 14PP
icon
Related questions
Question
7143CEM Programming for Data Science - Portfolio (draft version)
Task 2. Design, build and test (ILO2)
Unicorn vs Pegasus is a simple dice game for one player. The aim is to collect all the body parts of
either a Unicorn or a Pegasus (both mythical horse-like creatures). Rolling an unbiased eight-sided
dice, a 1 gives a body, 2 gives a tail, 3 gives a leg, 4 gives a head, 5 gives an eye, 6 gives a mouth, 7
gives a wing, and 8 gives a horn. A player must collect a body before any other body parts can be
added. A player must collect a head before any eyes, mouth or horn can be added.
Before you write any code, it is worth playing this game a few times using a pencil, paper and an
eight-sided dice (or use https://rolladie.net/roll-a-d8-die). Choose whether you are going to build a
Unicorn or Pegasus before you begin.
(1) Implement this game as one Python function. The function should have one parameter
which is used to select whether a Unicorn or a Pegasus is built. Follow the steps and logic
you take in a physical game. Your code should include enough print statements to generate
a clear nontrivial example illustrating a play of the game, telling the story as the dice is rolled
and the creature's body parts are assembled. Explain carefully what steps you have taken to
test your code (not just debugging). Please provide both your code and the output from one
sample run for each of Unicorn and Pegasus.
[15 marks]
(2) Modify your Python code to add at least three counts that effectively summarise a game,
e.g., how many dice rolls are made. Use these summary counts to compare building a
Unicorn with building a Pegasus. Also implement a variant in which the player builds one
complete Unicorn and one complete Pegasus in parallel (while carefully satisfying the
precedence of body parts for both creatures), and compare the resulting counts with those
of the original game (making some relevant conclusions). Please provide separate Python
code for the original game with counts and the variant, together with output from sample
runs of each and a comparison of counts in a table for the Unicorn-only, Pegasus-only and
both-in-parallel versions.
[10 marks]
Transcribed Image Text:7143CEM Programming for Data Science - Portfolio (draft version) Task 2. Design, build and test (ILO2) Unicorn vs Pegasus is a simple dice game for one player. The aim is to collect all the body parts of either a Unicorn or a Pegasus (both mythical horse-like creatures). Rolling an unbiased eight-sided dice, a 1 gives a body, 2 gives a tail, 3 gives a leg, 4 gives a head, 5 gives an eye, 6 gives a mouth, 7 gives a wing, and 8 gives a horn. A player must collect a body before any other body parts can be added. A player must collect a head before any eyes, mouth or horn can be added. Before you write any code, it is worth playing this game a few times using a pencil, paper and an eight-sided dice (or use https://rolladie.net/roll-a-d8-die). Choose whether you are going to build a Unicorn or Pegasus before you begin. (1) Implement this game as one Python function. The function should have one parameter which is used to select whether a Unicorn or a Pegasus is built. Follow the steps and logic you take in a physical game. Your code should include enough print statements to generate a clear nontrivial example illustrating a play of the game, telling the story as the dice is rolled and the creature's body parts are assembled. Explain carefully what steps you have taken to test your code (not just debugging). Please provide both your code and the output from one sample run for each of Unicorn and Pegasus. [15 marks] (2) Modify your Python code to add at least three counts that effectively summarise a game, e.g., how many dice rolls are made. Use these summary counts to compare building a Unicorn with building a Pegasus. Also implement a variant in which the player builds one complete Unicorn and one complete Pegasus in parallel (while carefully satisfying the precedence of body parts for both creatures), and compare the resulting counts with those of the original game (making some relevant conclusions). Please provide separate Python code for the original game with counts and the variant, together with output from sample runs of each and a comparison of counts in a table for the Unicorn-only, Pegasus-only and both-in-parallel versions. [10 marks]
Expert Solution
steps

Step by step

Solved in 3 steps

Blurred answer
Knowledge Booster
Datatypes
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr