Esempio n. 1
0
 def __init__(self, width):
     FlipTile.__init__(self, 1)
     self.__shards = [
         OneShard(self.getFrame(), width, 0, 5),
         OneShard(self.getFrame(), width, 1, 6),
         OneShard(self.getFrame(), width, 2, 7),
         OneShard(self.getFrame(), width, 3, 8),
         OneShard(self.getFrame(), width, 4, 9),
         OneShard(self.getFrame(), width, 5, 10),
         OneShard(self.getFrame(), width, 6, 11),
         OneShard(self.getFrame(), width, 7, 12)
     ]
Esempio n. 2
0
 def __init__(self, width):
     FlipTile.__init__(self, 1)
     self.__shards = [
         OneShard(self.getFrame(), width, 0, 5),
         OneShard(self.getFrame(), width, 1, 6),
         OneShard(self.getFrame(), width, 2, 7),
         OneShard(self.getFrame(), width, 3, 8),
         OneShard(self.getFrame(), width, 4, 9),
         OneShard(self.getFrame(), width, 5, 10),
         OneShard(self.getFrame(), width, 6, 11),
         OneShard(self.getFrame(), width, 7, 12)
     ]
Esempio n. 3
0
    def __init__(self, inSync):
        FlipTile.__init__(self, 5)

        self.__blocks = []
        self.__states = []
        self.__random = Random()

        for border in range(4):
            size = 8 - border * 2
            b = Block(size, size).fill(LampState.FLIP)
            self.getFrame().add(b, border, border)
            self.__blocks.append(b)
            self.__states.append(False)

        self.__inSync = inSync
Esempio n. 4
0
    def __init__(self):
        FlipTile.__init__(self, 1)

        def bouncer():
            while True:
                for i in range(6): yield i
                for i in range(6): yield 6 - i

        self.__hor = Block(8, 2).fill(LampState.FLIP)
        self.getFrame().add(self.__hor, 0, 0)

        self.__ver = Block(2, 8).fill(LampState.FLIP)
        self.getFrame().add(self.__ver, 0, 0)

        self.__xGen = bouncer()
        self.__yGen = bouncer()
Esempio n. 5
0
    def __init__(self):
        FlipTile.__init__(self, 1)

        sun = Block('011110 111111 111111 111111 111111 011110')
        moon = Block('.00. 0000 0000 .00.')

        self.getFrame().add(sun, 0, 0).add(moon, 0, 0)

        def bouncer(size):
            while True:
                for i in range(8 + 1 - size): yield i
                # for i in range(8 - size): yield 8 - size - i

        self.__sunGen = bouncer(6)
        self.__moonGen = bouncer(4)

        self.__sun = sun
        self.__moon = moon
Esempio n. 6
0
    def __init__(self):
        FlipTile.__init__(self, 1)

        sun = Block('011110 111111 111111 111111 111111 011110')
        moon = Block('.00. 0000 0000 .00.')

        self.getFrame().add(sun, 0, 0).add(moon, 0, 0)

        def bouncer(size):
            while True:
                for i in range(8 + 1 - size):
                    yield i
                # for i in range(8 - size): yield 8 - size - i

        self.__sunGen = bouncer(6)
        self.__moonGen = bouncer(4)

        self.__sun = sun
        self.__moon = moon
Esempio n. 7
0
    def __init__(self):
        FlipTile.__init__(self)

        cross1 = Block(8, 8).fill(LampState.OFF)
        cross2 = Block(8, 8).fill(LampState.OFF)

        for i in range(0, 8):
            cross1.setLamp(i, i, LampState.ON)
            cross1.setLamp(i, 7 - i, LampState.ON)

        for i in range(0, 8):
            cross2.setLamp(3, i, LampState.ON)
            cross2.setLamp(4, i, LampState.ON)
            cross2.setLamp(i, 3, LampState.ON)
            cross2.setLamp(i, 4, LampState.ON)

        self.getFrame().add(cross1, 0, 0).add(cross2, 0, 0)

        self.__cross1 = cross1
        self.__cross2 = cross2
Esempio n. 8
0
    def __init__(self):
        FlipTile.__init__(self)

        cross1 = Block(8, 8).fill(LampState.OFF)
        cross2 = Block(8, 8).fill(LampState.OFF)

        for i in range(0, 8):
            cross1.setLamp(i, i, LampState.ON)
            cross1.setLamp(i, 7 - i, LampState.ON)

        for i in range(0, 8):
            cross2.setLamp(3, i, LampState.ON)
            cross2.setLamp(4, i, LampState.ON)
            cross2.setLamp(i, 3, LampState.ON)
            cross2.setLamp(i, 4, LampState.ON)

        self.getFrame().add(cross1, 0, 0).add(cross2, 0, 0)

        self.__cross1 = cross1
        self.__cross2 = cross2