Exemplo n.º 1
0
def test_building():
    from task import mc
    tbwp = test_building_with_pattern(mc, building_pattern)
    if not tbwp:
        return False
    building_guess = mc.building
    for y in range(y1, y1 + height):
        prev_xyz = (x1, y, z)
        prev = building_guess[prev_xyz]
        for x in range(x1 + 1, x1 + width):
            xyz = (x, y, z)
            if prev == building_guess[xyz]:
                failed("Blocks at " + str(xyz) + " and " + str(prev_xyz) + " are both " + str(prev))
                return False
            prev = building_guess[xyz]
            prev_xyz = (x, y, z)
Exemplo n.º 2
0
def test_building():
    from task import b
    if test_building_with_pattern(b, building_pattern):
        torches = 0
        for key, value in b.building.items():
            if value == "default:torch":
                torches += 1
        if torches < 5:
            failed("Only " + str(torches) + " torches. Should be 6")
            return False
        if torches > 6:
            failed("Too many torches. Should be 6. There are " + str(torches))
            return False
        return True
    else:
        return False
Exemplo n.º 3
0
def test_building():
    from task import mc
    success = test_building_with_pattern(mc, building_pattern)
    if not success:
        return False
    # Check no adjacent blocks the same
    keys=sorted(mc.building.keys())
    key_prev=(-100, -100, -100)
    wool_prev = ""
    for key in keys:
        wool = mc.building[key]
        if wool == wool_prev and abs(key[0]-key_prev[0]) < 2 and abs(key[1]-key_prev[1]) < 2:
            # adjacent the same so fail
            failed("Blocks at " + str(key_prev) + " and " + str(key) + " are adjacent but are both " + str(wool))
            return False
    return True
Exemplo n.º 4
0
def test_building():
    from task import mc
    return test_building_with_pattern(mc, building_pattern)
Exemplo n.º 5
0
def test_building():
    from task import b
    return test_building_with_pattern(b, building_pattern)
Exemplo n.º 6
0
def test_building():
    from task import b
    # print(f"{b.building=}")
    return test_building_with_pattern(b, building_pattern)