Ejemplo n.º 1
0
    def viswrap_draw(self):
        print(nl*5)
        # print("self.vtopleft.y", self.vtopleft.y)
        rows = Loop(self.board, "row", index=self.vtopleft.y)

        for _ in range(self.vheight):
            cols = Loop(rows.row, index=self.vtopleft.x)
            print(space, ujoin( topitems(cols.n_items(self.vwidth)) ))
            rows.next()

        sleep(pause_time)
Ejemplo n.º 2
0
class Reel(object):
    def __init__(self, rotations, max_cycle):
        self.reel      = Loop(symbols.keys(), name="symbol")
        self.rotations = rotations
        self.max_cycle = max_cycle

    def symbol(self, cycle=0):
        if cycle and cycle <= self.max_cycle:
            self.rotate()
        return self.reel.symbol

    def rotate(self): self.reel.next(self.rotations)