turtle code. I need to create a Jython application that takes turtle code from the Java application, parses it with regular expressions and calls setPixel(x,y)
in the Java application to draw a rectangle. the Java program ,setPixel(x, y) is used to control the painting and getCode() to get the code entered in to the turtle
code textarea. These methods are both defined in the DYPL Java class.
- Code: Select all
def actionPerformed(self, event):
print("Button clicked. Got event:")
def move(self, x,y):
move(50, 90) # is move a built in function
def put(self, x,y,a):
put(150, 150, 0)
for x in range(0,4): #how come it doesn't draw a rectangle as mentioned?
eval("self."+self.obj.getCode()+"()")#why do we need this?
def setDYPL( self, obj ):
print("Got a DYPL instance: ")
if __name__ == '__main__':
I also attach a zip file containing classes like Translater.class,DYPLCanvas.java etc if you need it. so does anyone know how I should start?