3. PIVOTING DIE (5 MARKS) Consider the board below, which can be imagined as being infinite,...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
3. PIVOTING DIE (5 MARKS) Consider the board below, which can be imagined as being infinite, so only a small part is represented. A die is placed on cell number 1 of the board in the position indicated: 3 at the top, 2 at the front (towards cell number 4 of the board), and 1 on the right (towards cell number 2 of the board). Recall that 4 is opposite to 3, 5 is opposite to 2, and 6 is opposite to 1. The die can be moved from cell 1 to cell 2, then to cell 3, then to cell 4..., each time pivoting by 90 degrees in the appropriate direction (to the right, forwards, to the left, or backwards). For instance, after it has been moved from cell 1 to cell 2, 2 is still at the front but 6 is at the top and 3 is on the right. 43 44 45 46 47 48 49 42 21 22 23 24 25 26 41 20 7 8 9 10 27 19 6 1 2 11 28 40 39 18 5 4 3 12 29 38 17 16 15 14 13 30 37 36 35 34 33 32 31 Enter the desired goal cell number: A Incorrect value, try again Enter the desired goal cell number: Incorrect value, try again Enter the desired goal cell number: -1 Incorrect value, try again 50 Write a program, stored in a file named pivoting_die.py, that prompts the user for a strictly positive integer N, and outputs the numbers at the top, the front and the right after the die has been moved to cell N. Here is a possible interaction. $python3 pivoting_die.py Enter the desired goal cell number: 0 Incorrect value, try again . Enter the desired goal cell number: 1 On cell 1, 3 is at the top, 2 at the front, and 1 on the right. $ python3 pivoting_die.py 3 Enter the desired goal cell number: 29 On cell 29, 3 is at the top, 2 at the front, and 1 on the right. $python3 pivoting_die.py Enter the desired goal cell number: 2006 On cell 2006, 4 is at the top, 1 at the front, and 2 on the right. 3. PIVOTING DIE (5 MARKS) Consider the board below, which can be imagined as being infinite, so only a small part is represented. A die is placed on cell number 1 of the board in the position indicated: 3 at the top, 2 at the front (towards cell number 4 of the board), and 1 on the right (towards cell number 2 of the board). Recall that 4 is opposite to 3, 5 is opposite to 2, and 6 is opposite to 1. The die can be moved from cell 1 to cell 2, then to cell 3, then to cell 4..., each time pivoting by 90 degrees in the appropriate direction (to the right, forwards, to the left, or backwards). For instance, after it has been moved from cell 1 to cell 2, 2 is still at the front but 6 is at the top and 3 is on the right. 43 44 45 46 47 48 49 42 21 22 23 24 25 26 41 20 7 8 9 10 27 19 6 1 2 11 28 40 39 18 5 4 3 12 29 38 17 16 15 14 13 30 37 36 35 34 33 32 31 Enter the desired goal cell number: A Incorrect value, try again Enter the desired goal cell number: Incorrect value, try again Enter the desired goal cell number: -1 Incorrect value, try again 50 Write a program, stored in a file named pivoting_die.py, that prompts the user for a strictly positive integer N, and outputs the numbers at the top, the front and the right after the die has been moved to cell N. Here is a possible interaction. $python3 pivoting_die.py Enter the desired goal cell number: 0 Incorrect value, try again . Enter the desired goal cell number: 1 On cell 1, 3 is at the top, 2 at the front, and 1 on the right. $ python3 pivoting_die.py 3 Enter the desired goal cell number: 29 On cell 29, 3 is at the top, 2 at the front, and 1 on the right. $python3 pivoting_die.py Enter the desired goal cell number: 2006 On cell 2006, 4 is at the top, 1 at the front, and 2 on the right.
Expert Answer:
Related Book For
Applied Regression Analysis and Other Multivariable Methods
ISBN: 978-1285051086
5th edition
Authors: David G. Kleinbaum, Lawrence L. Kupper, Azhar Nizam, Eli S. Rosenberg
Posted Date:
Students also viewed these programming questions
-
If the focal length of a lens is 3 centimeters and the image distance is 5 centimeters from the lens, what is the distance from the object to the lens?
-
Ayayai Company prepares its statement of cash flows using the direct method for operating activities. For the year ended December 31, 2024, Ayayai Company reports the following: Sales on account...
-
Find the volumes of the solids in Problems 4952 correct to the nearest unit. 4 cm -6 cm 8 cm
-
A charge of 6.15 mC is placed at each corner of a square 0.100 m on a side. Determine the magnitude and direction of the force on each charge.
-
1. Consider the following statement: Government-funded projects intended to serve as prestige projects, such as the Big Dig, should not be judged on the basis of cost. Do you agree or disagree with...
-
Ron Chambers arrives at work early on Friday morning. His anxiety has been growing throughout his final week of training with Mid-Town Office Products. Today Ron is going to work with his sales...
-
Night Glow Inc. recently began production of a new product, the halogen light, which required the investment of $ 600,000 in assets. The costs of producing and selling 10,000 halogen lights are...
-
The York City Hospital has just acquired new equipment. The equipment cost $ 4 , 2 5 0 , 0 0 0 , and the organization spent $ 1 3 5 , 0 0 0 on upgrading the physical plant to the new equipment will...
-
The Porsche Club of America sponsors driver education events that provide high-performance driving instruction on actual racetracks. Because safety is a primary consideration at such events, many...
-
e: One of the most common networking sites today is Twitter. People are able to share their personal thoughts with the world through this free social media platform. For Twitter, users are allowed...
-
Distinguish between criminal liability and civil liability.
-
Define appellant ; respondent ; counterclaim ; counsel ; bench ; writ ; settlement ; pleadings ; party and party costs ; res judicata .
-
How does a judge decide a case when there is no precedent available in earlier decisions?
-
Motion pictures and television programs are responsible for a misconception about the way in which trials proceed. Explain.
-
How is the legal infrastructure of a country significant for business?
-
A hurricane force wind of 200 km/h blows across the face of a storefront window. Estimate the force on the 2.2m x 3.5m window due to the difference in air pressure inside and outside the window....
-
Some people argue that the internal control requirements of the Sarbanes-Oxley Act (SOX) put U.S. companies at a competitive disadvantage to companies outside the United States. Discuss the...
-
a.-d. Repeat Problem 3, using REACTIM2 as the dependent variable and referring to the accompanying computer output. In problem 3 a. Observe the cross-tabulation of AGEGROUP and PPM_CO in the...
-
The following table gives the average patient waiting time in minutes for patients from a random sample of 16 physicians, classified by type of practice and type of physician a. Classify each factor...
-
A five-year follow-up study was carried out to assess the relationship of diet and weight to the incidence of stomach cancer in 40- to 50-year-old males in a certain metropolitan area. Let K- denote...
-
Steam at \(1,000 \mathrm{kPa}\) and \(300^{\circ} \mathrm{C}\) enters an engine and expands to \(20 \mathrm{kPa}\). If the exhaust steam has a dryness fraction of 0.9 , make calculations for the drop...
-
Combined separating and throttling calorimeter is used to find out dryness fraction of steam, following readings were taken: Main pressure \(=12\) bar abs. Mass of water collected in separating...
-
Determine the quality of steam for the following cases: (i) \(P=10\) bar, \(v=0.180 \mathrm{~m}^{3} / \mathrm{k}\) (ii) \(P=10\) bar, \(t=200^{\circ} \mathrm{C}\) (iii) \(P=25 \mathrm{bar}, h=2,750...
Study smarter with the SolutionInn App