terminate when tile_bag is empty