Skip to content

Code Review - #3

Open
RectoFractal wants to merge 117 commits into
SPBUnited-Junior:masterfrom
RectoFractal:master
Open

Code Review#3
RectoFractal wants to merge 117 commits into
SPBUnited-Junior:masterfrom
RectoFractal:master

Conversation

@RectoFractal

Copy link
Copy Markdown

No description provided.

Comment thread bridge/router/base_actions.py Outdated

maxAngle = angle_bounds*180/math.pi-minDeltaAngle
# print(maxAngle)
difference = (distToAim)/(((const.FIELD_DX*2)**2+(const.FIELD_DY*2)**2)**0.5)*maxAngle*1.4

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Не сразу понятно что это теорема пифагора, я бы функцию в ауксилярий написал или коммент хотя бы оставил

Очев это не вияет на рабочесть кода, просто для внешнего просматривающего будет проще, и тебе потом если править будешь

Comment thread bridge/strategy/myFunc.py Outdated
closests = [(10.0**10, 10.0**10, aux.Point(0, 0)), (10.0**10, 10.0**10, aux.Point(1, 0)), (10.0**10, 10.0**10, aux.Point(0, 1)), (10.0**10, 10.0**10, aux.Point(0, 1))]
minDist = 10.0**10

delta = 500#magic koef which we need for normal working programm

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:D

Comment thread bridge/strategy/myFunc.py Outdated

dist2Goal = aux.dist(point, centerEnemyGoal)
if dist2r < minDist:
for i in range(4):

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ваще не понятно что тут происходит, я бы пару комментов оставил

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

еще эта 4ка несколько раз встречается, я бы вынес ее в локальную константу с говорящим названием

Comment thread bridge/strategy/myFunc.py Outdated
receiverR = field.enemies[receiverRId]
receiverRPos = receiverR.get_pos()
else:
receiverRPos = aux.rotate(aux.RIGHT, givingR.get_angle())*(((const.FIELD_DX*2)**2+(const.FIELD_DY*2)**2)**0.5)+givingRPos

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

о опять теорема пифагора, значит точно выноси функцию в ауксилярий

Comment thread bridge/strategy/myLogicFunc.py Outdated
else:
"""if ball of our part of field, build wall without space"""
nowDistBetweenRsInWall = 200
angle = math.asin((nowDistBetweenRsInWall/2)/((nowDistBetweenRsInWall/2)**2+(const.KEEP_BALL_DIST+50)**2)**0.5)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

опять пифагор

Comment thread bridge/strategy/myLogicFunc.py Outdated
mostLikelyPointForScore = aux.closest_point_on_line(field.ally_goal.up, field.ally_goal.down, ballPos)
actions[idxThisR] = Actions.BallGrab((ballPos-mostLikelyPointForScore).arg())
else:
"""try replace ball from our part of field"""

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

replace это "замена" а не "перемещение")

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants