# No Z-constant for you!
def retSubnet(sw):
(rad,num) = sw
- if rad <= 7 or (rad == 8 and (sw <= 3 or sw == 6)):
+ drad = (rad - 1) / 2
+ if drad <= 7 or (drad == 8 and (sw <= 3 or sw == 6)):
return "241"
- if rad <= 13 or (rad == 14 and sw != 4) or (rad == 15 and sw <= 3):
+ if drad <= 13 or (drad == 14 and sw != 4) or (drad == 15 and sw <= 3):
return "242"
- if rad <= 22 or (rad == 23 and sw >= 4) or (rad == 24 and sw == 4):
+ if drad <= 22 or (drad == 23 and sw >= 4) or (drad == 24 and sw == 4):
return "243"
- if rad <= 29 or (rad == 30 and (sw == 4 or sw == 5)):
+ if drad <= 29 or (drad == 30 and (sw == 4 or sw == 5)):
return "244"
return "245"