python - angles commands in superclass -


How do you write a command that turns left or right in a superclass at an angle this way:

  def left (self): self.position + = self.angle return (self.position)  

This is similar to the back and forth command

It seems that you have some interest in the logo like turtle.

If this is the case, then the left function can not change the state of turtle, but its orientation.

  def left (self, angle): self.angle - = angle * 2 * math.pi / 360  

Comments

Popular posts from this blog

asp.net - Javascript/DOM Why is does my form not support submit()? -

sockets - Delphi: TTcpServer, connection reset when reading -

javascript - Classic ASP "ExecuteGlobal" statement acting differently on two servers -