Use our own hypot() for older Python support

This commit is contained in:
2021-04-28 07:12:30 +00:00
parent af9cc4b546
commit aec057c89c
23 changed files with 28 additions and 28 deletions
+2 -3
View File
@@ -2,7 +2,6 @@ import collections
import re
import time
import random
from math import hypot
from itertools import count
from copy import copy
@@ -35,7 +34,7 @@ class World:
continue
if y_limit and abs(cur[1]) > y_limit:
continue
if distance and hypot(*cur) > distance:
if distance and utils.hypot(*cur) > distance:
continue
check = utils.padd(center, cur)
@@ -76,7 +75,7 @@ class World:
offset = utils.spiral(n)
check = utils.padd(center, offset)
if self.block_at(*check) in block_ids:
if hypot(*offset) < distance:
if utils.hypot(*offset) < distance:
result.append(check)
if limit and len(result) == limit:
return result