Code Review - #3
Open
RectoFractal wants to merge 117 commits into
Open
Conversation
GlazovYuri
reviewed
Jun 4, 2026
|
|
||
| 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 |
Contributor
There was a problem hiding this comment.
Не сразу понятно что это теорема пифагора, я бы функцию в ауксилярий написал или коммент хотя бы оставил
Очев это не вияет на рабочесть кода, просто для внешнего просматривающего будет проще, и тебе потом если править будешь
GlazovYuri
reviewed
Jun 4, 2026
| 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 |
GlazovYuri
reviewed
Jun 4, 2026
|
|
||
| dist2Goal = aux.dist(point, centerEnemyGoal) | ||
| if dist2r < minDist: | ||
| for i in range(4): |
Contributor
There was a problem hiding this comment.
ваще не понятно что тут происходит, я бы пару комментов оставил
Contributor
There was a problem hiding this comment.
еще эта 4ка несколько раз встречается, я бы вынес ее в локальную константу с говорящим названием
GlazovYuri
reviewed
Jun 4, 2026
| 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 |
Contributor
There was a problem hiding this comment.
о опять теорема пифагора, значит точно выноси функцию в ауксилярий
GlazovYuri
reviewed
Jun 4, 2026
| 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) |
GlazovYuri
reviewed
Jun 4, 2026
| 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""" |
Contributor
There was a problem hiding this comment.
replace это "замена" а не "перемещение")
GlazovYuri
requested changes
Jun 4, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.