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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started