def test_bst(n):
    arr = util.get_random_array(n)
    util.print_array(arr)
    bst = BST()
    for i in arr:
        bst.put(i, "data-%d" % i)
    print("after put size", bst.size())
    for i in arr:
        bst.delete(i)
        print("after delete %d size" % i, bst.size())
Exemple #2
0
                    map[Point(self.x, self.y)] = 0
                elif v == 3:
                    #print('paddle at %x,%x' % (self.x,self.y))
                    paddlex = self.x
                    map[Point(self.x, self.y)] = 0
                else:
                    map[Point(self.x, self.y)] = v

        self.p = (self.p + 1) % 3


lines = data.strip().split('\n')
prog = Program(data)

prog.run(Reader(), Writer())

cnt = 0
for p, v in map.items():
    if v == 2:
        cnt += 1

util.print_array(util.gridify_sparse_map(map))

print("%d block tiles" % cnt)

prog.reset()
prog.mem[0] = 2
prog.run(Reader(), Writer())

print(score)