Example #1
0
 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)
Example #2
0
 def setUp(self):
     self.Reader = ArgumentSourceReader(ArgumentParser(TurtleDrawer()))
     self.source = ['-e', '-t', '-k', '-g']
Example #3
0
 def setUp(self):
     self.tkinterIntParser = IntegerParser(TurtleDrawer())
     self.source = ['1', '2', '3', '4', '5', '6', '7', '8', '9', '0']
Example #4
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'
     ]
Example #5
0
 def do_circle(self, arg):
     """Draw Circle"""
     self.results.writeToFile("Drawing a circle")
     command = IntegerParser.parse(self, arg)
     TurtleDrawer.draw_circle(self, command)
Example #6
0
 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)
Example #7
0
 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)
Example #8
0
 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)
Example #9
0
 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)
Example #10
0
 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)
Example #11
0
 def do_D(self, arg):
     """Pen Down : D"""
     self.results.writeToFile("Pen is down")
     TurtleDrawer.pen_down(self)
Example #12
0
 def do_U(self, arg):
     """Pen Up : U"""
     self.results.writeToFile("Pen is up")
     TurtleDrawer.pen_up(self)
Example #13
0
 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)