Jakepulleyportfolio.files.wordpress.com



Pseudo code for projectImpot randomImport timeFrom tkinter import *Window = Tk()Canvas = Canvas(window, width, height, bg)Canvas.pack()Path = [coordinates]Path2 = [coordinates]X_min = minimum on-screen location xY_min = minimum on-screen location yX_max = maximum on-screen location xY_max = maximum on-screen location yVar = robot(square.small)Var = obstacle (rectangle.large, ‘red’)Var = obstacle(rectangle.large, ‘blue’)Robot.coords = x1, y1, x2, y2WHILE robot.coords =< x_max or =< y_max:robot.coords = x + 1, y + 1canvas.updateIF robot touches obstacle:Robot.coords = away from obstaclePRINT “Hit obstacle”IF robot = x_min OR y_min:Robot.coords = largerPRINT “Hit canvas frame” ELIF robot = y_max or x_max:Robot.coords = smallerButton = (window, text, location)Button.pack(side)Window.mainloop() ................
................

In order to avoid copyright disputes, this page is only a partial summary.

Google Online Preview   Download