Question: PLEASE USE PYTHON 3 : Write a Tom and Jerry game using the turtle module. The rules of the game are given as follows: A
PLEASE USE PYTHON 3 :
Write a "Tom and Jerry" game using the turtle module. The rules of the game are given as follows: A room is designed with a grid. Both Jerry and Tom can only move on the grid within the room. Jerry will start from the center of the room, and for every step he can randomly pick one out of four directions to go. Tom will also start from the center of the room, but k steps after Jerry. For every step Tom will move towards Jerry along the closest path. If there are more than one closest path, then Tom will randomly pick one path to go. The game will end when Tom meets Jerry, i.e., both of them appear at the same position.
- Write three classes: Room, Tom, Jerry. Provide the necessary attributes and methods for each of them.
- Write a function __main__() to simulate the game on a turtle screen.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
