Skip to content

KedarMore/Implemneting-Bug-Algorithms

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 

Repository files navigation

BUG ALGORITHMS

python3 final.py

The code will ask you 3 questions:

  1. Which Workspace???

Ans: 1 or 2

OR

  1. Which Bug???

Ans: 1 or 2

  1. 'left' or 'right' turning???

Ans: left or right

Finally the code will print the total distance travelled by the Bug.

Workspace1Bug1

Workspace2Bug1

Workspace1Bug2

Workspace2Bug2

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

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages