Zaktualizuj 'Traktorek/Tractor.py'
This commit is contained in:
parent
c7d6842d51
commit
4a18cc04b9
@ -82,14 +82,8 @@ class Tractor(object):
|
|||||||
# s to pole na którym jesteśmy
|
# s to pole na którym jesteśmy
|
||||||
# f to pole końcowe
|
# f to pole końcowe
|
||||||
def hscore(self, s, f):
|
def hscore(self, s, f):
|
||||||
if f >= s:
|
a_h = m.fabs(s - f) // 5
|
||||||
a_h = (f - s) // 5
|
b_h = m.fabs(f % 5 - s % 5)
|
||||||
else:
|
|
||||||
a_h = (s - f) // 5
|
|
||||||
if f % 5 >= s % 5:
|
|
||||||
b_h = f % 5 - s % 5
|
|
||||||
else:
|
|
||||||
b_h = s % 5 - f % 5 + 1
|
|
||||||
return 2 * m.sqrt(a_h ** 2 + b_h ** 2)
|
return 2 * m.sqrt(a_h ** 2 + b_h ** 2)
|
||||||
|
|
||||||
# A*
|
# A*
|
||||||
|
Loading…
Reference in New Issue
Block a user