python3 final.py
The code will ask you 3 questions:
- Which Workspace???
Ans: 1 or 2
OR
- Which Bug???
Ans: 1 or 2
- 'left' or 'right' turning???
Ans: left or right
Finally the code will print the total distance travelled by the Bug.
To change the workspace write the positions of rectangles in the following format:
W1O0=Polygon([(1,1),(2,1),(2,5),(1,5)])
W1O1=Polygon([(3,4),(4,4),(4,12),(3,12)])
W1O2=Polygon([(3,12),(12,12),(12,13),(3,13)])
W1O3=Polygon([(12,5),(13,5),(13,13),(12,13)])
W1O4=Polygon([(6,5),(12,5),(12,6),(6,6)])
Workspace1=[W1O0,W1O1,W1O2,W1O3,W1O4]
and replace it in final.py