Download the Medialib ex5 code files and 7 image files (as shown below) from the gallery and complete the program in ex5.py.
Create a program with MediaLib to realise a simple dice game by modifying the code from the previous exercise for drawing a dice face:
Click the window of MediaLib to roll the 1st dice (generate a random integer in [1, 6]) and draw the dice face on the left part of the window.
Click the window to roll the 2nd dice and draw the dice face on the right part of the window.
Click the window to check which side wins. Draw a gold medal (medal1.png) under the winner and a silver medal (medal2.png) for the other. If it is a tied game, then draw two gold medals.
Hints:
To generate a random integer, use the function randint(a,b) from the random module which will return an integer in the range [a,b].
You can modify the function draw_dice_face(n) created in the previous exercise to, for example, draw_dice_face(n, side).
You can create a function draw_medal(place, side) for drawing one of the medals.