Question: In this program, you will check whether two dominoes match. Three dominoes. The first domino has a 1 on the left and a 5 on
In this program, you will check whether two dominoes match.
Three dominoes. The first domino has a on the left and a on the right. The third domino has a on the left and on the right. The second domino has a touching the on the first domino and a touching the on the third domino.
Because you can rotate a tile, two tiles match if the number on the left or right matches the left or right on the other tile. For example, the domino maches the domino without rotating either, and matches after flipping the first domino.
You should print all matches. First check a direct match, then try rotating tiles. But don't flip a tile whose left and right numbers are the same. If there is no match, print No match".
Don't restructure the code. Fill in a condition for each of the if # Your code goes here statements. Empty print statements are included for output formatting.printFirst domino."
left intinputleft value:
print
right intinputright value:
print
printSecond domino."
left intinputleft value:
print
right intinputright value:
print
matched False
flip left right
flip left right
if # Your code goes here :
printMatch without flipping"
matched True
if # Your code goes here :
printMatch after flipping first domino"
matched True
if # Your code goes here :
printMatch after flipping second domino"
matched True
if # Your code goes here :
printMatch after flipping both dominos"
matched True
if # Your code goes here :
printNo match"
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
