Question: Python Question : Generate two very hungry turtles and one carrot. Carrot does not move. Hungry turtles search for the carrot in a 500x500 arena.
Python Question :
Generate two very hungry turtles and one carrot. Carrot does not move. Hungry turtles search for the carrot in a 500x500 arena. They use random search algorithm for their search. They have four options to move: up, down, left, right and they choose randomly one of them until they find the carrot. Use threading to keep CPU always working for the search. One turtles speed is 2 and the other one is 4. Hungry turtles will start search from opposite corners of the arena, and the carrot will be at the middle bottom of the arena. Turtles step size is 10 pixels. Some methods: isWall() : checks if turtle hits the wall or not isFound(): checks if turtle finds the carrot
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
