def do_square(self, arg): """Draw Square""" self.results.writeToFile("Drawing a square") command = IntegerParser.parse(self, arg) directions = [0, 90, 180, 270] for i in directions: TurtleDrawer.draw_line(self, i, command)
def setUp(self): self.Reader = ArgumentSourceReader(ArgumentParser(TurtleDrawer())) self.source = ['-e', '-t', '-k', '-g']
def setUp(self): self.tkinterIntParser = IntegerParser(TurtleDrawer()) self.source = ['1', '2', '3', '4', '5', '6', '7', '8', '9', '0']
def setUp(self): self.tkinterParser = ArgumentParser(TurtleDrawer()) self.source = [ '-c', '-e', '-t', '-k', '-g', '1', '2', '3', '4', '5', '6', '7', '8', '9', '0' ]
def do_circle(self, arg): """Draw Circle""" self.results.writeToFile("Drawing a circle") command = IntegerParser.parse(self, arg) TurtleDrawer.draw_circle(self, command)
def do_W(self, arg): """Draw line 270 degrees : W 100""" self.results.writeToFile("Draw line 270 degrees : W", arg) command = IntegerParser.parse(self, arg) TurtleDrawer.draw_line(self, 270, command)
def do_E(self, arg): """Draw line 90 degrees : E 100""" self.results.writeToFile("Draw line 90 degrees : E", arg) command = IntegerParser.parse(self, arg) TurtleDrawer.draw_line(self, 90, command)
def do_S(self, arg): """Draw line 120 degrees : S 100""" self.results.writeToFile("Draw line 120 degrees : S", arg) command = IntegerParser.parse(self, arg) TurtleDrawer.draw_line(self, 180, command)
def do_Y(self, arg): """Go Down : Y 100""" self.results.writeToFile("Go Along : Y", arg) command = IntegerParser.parse(self, arg) TurtleDrawer.go_down(self, command)
def do_X(self, arg): """Go Along : X 100""" self.results.writeToFile("Go Along : X ", arg) command = IntegerParser.parse(self, arg) TurtleDrawer.go_along(self, command)
def do_D(self, arg): """Pen Down : D""" self.results.writeToFile("Pen is down") TurtleDrawer.pen_down(self)
def do_U(self, arg): """Pen Up : U""" self.results.writeToFile("Pen is up") TurtleDrawer.pen_up(self)
def do_P(self, arg): """Select Pen: P 10""" self.results.writeToFile("Selected pen", arg) data = IntegerParser.parse(self, arg) TurtleDrawer.select_pen(self, data)