def test_find_holes(): value = np.int64(0x110101000101) # Positions not empty: 0, 2, 6, 8, 10, 11 arr = e2048.build_array(value) holes = e2048._find_holes(arr) expected_positions = np.array([ (0, 1), (0, 3), (1, 0), (1, 1), (1, 3), (2, 1), (3, 0), (3, 1), (3, 2), (3, 3)]) assert (expected_positions == holes).all() for hole in holes: assert arr[hole] == 0
def check_building_arrays_equals(value): arr_built = e2048.build_array(value) value_built = e2048.build_value(arr_built) print hex(value_built), hex(value) assert value_built == value