Ejemplo n.º 1
0
    def __init__(self, interactive=False, delay=100):
        World.__init__(self)
        self.delay = delay
        self.title('AmoebaWorld')
        self.running = False

        self.make_canvas()
        if interactive:
            self.make_control_panel()
Ejemplo n.º 2
0
    def __init__(self, canvas_size=500, cell_size=5, interactive=False):
        World.__init__(self)
        self.title('CellWorld')
        self.canvas_size = canvas_size
        self.cell_size = cell_size

        # cells is a map from index tuples to Cell objects
        self.cells = {}

        if interactive:
            self.make_canvas()
            self.make_control()
Ejemplo n.º 3
0
    def __init__(self, interactive=False):
        World.__init__(self)
        self.title('TurtleWorld')

        # the interpreter executes user-provided code
        g = globals()
        g['world'] = self
        self.make_interpreter(g)

        # make the GUI
        self.setup()
        if interactive:
            self.setup_interactive()