-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy paththree_cups.py
More file actions
32 lines (27 loc) · 1014 Bytes
/
Copy paththree_cups.py
File metadata and controls
32 lines (27 loc) · 1014 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
def main():
three_cups = "000"
position = ""
swaps = ""
print(
"\nThere is one small blue ball and three opaque cups on a table, positioned at left(L) , middle(M), right(R), beside each other in a straight line."
)
position = input(
"Choose which cup, Left(L), Middle(M) or Right(R) underwhich you will hide the blue ball!"
)
if position == "L":
three_cups = "B00"
if position == "M":
three_cups = "0B0"
if position == "R":
three_cups = "00B"
print("Position entered by user:", position)
print("Initial setup of the three cups:", three_cups)
print(
"There are three types of swaps that can be made:\nA- Swap Left and Middle cups,\n B- Swap Middle and Right cups,\n C- Swap Left and Right Cups"
)
swaps = input(
"Enter a string of swaps and we will determine the final location of the cup under which the of the blue ball is hidden!"
)
print(swaps)
if __name__ == "__main__":
main()