Ejemplo n.º 1
0
 def run(self, runs=RUNS):
     res = display.init_board(runs=runs, weights=self.weights)
     if res == None:
         return
     return (self.getMean(res), max(res))
Ejemplo n.º 2
0
                b.append((self.x + col + dx, self.y + row + dy))
            col += 1
            if col == 4:
                col = 0
                row += 1
            bit = bit >> 1
        return b

    def __init__(self):
        if len(Piece.bag) == 0:
            Piece.bag = Piece.pieces[:]
            shuffle(Piece.bag)
        self.x = 4
        self.y = 20
        self.di = 0
        self.type = Piece.bag.pop()


if __name__ == "__main__":
    w = {
        "width": -6.9001180649744,
        "below": -35.037893648236796,
        "height": 20.425945151635126,
        "spacesBelow": 39.671887814525746,
        "center": 0.6651028954848819,
        "edge": -11.524396180016335,
        "sides": 18.51376514208485,
        "clears": 23.352934144427465,
    }
    display.init_board(win=True, weights=w)