#!/usr/bin/env python #bigradial.py from graphics import* from random import random import math def main(): win = GraphWin("Random Walk Simulator", 640, 480) win.setCoords(0.0, 0.0, 100.0, 100.0) print "A random walk simulator.\n" n = input("How many steps will you take? ") x = 50 y = 50 p1 = Point(x, y) for points in range(n): angle = random() * 2 * math.pi x = x + math.cos(angle) y = y + math.sin(angle) p2 = Point(x, y) p2.draw(win) line = Line(p1,p2) line.setWidth(1) #line.setArrow('last') #line.draw(win) raw_input("Press to quit") win.close() if __name__ == '__main__': main()