Skip to content

makeRobot#2516

Open
RomanPerepelkin wants to merge 3 commits into
mate-academy:masterfrom
RomanPerepelkin:develop
Open

makeRobot#2516
RomanPerepelkin wants to merge 3 commits into
mate-academy:masterfrom
RomanPerepelkin:develop

Conversation

@RomanPerepelkin

Copy link
Copy Markdown

No description provided.

@volodymyr-soltys97 volodymyr-soltys97 left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Good job 👍
Let's improve your code

Comment thread src/makeRobot.js Outdated
Comment on lines +42 to +46
goRight: goRight,
goLeft: goLeft,
goForward: goForward,
goBack: goBack,
evacuate: evacuate,

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Redundant

Suggested change
goRight: goRight,
goLeft: goLeft,
goForward: goForward,
goBack: goBack,
evacuate: evacuate,

Comment thread src/makeRobot.js
Comment on lines +52 to +55
coords: {
'x': 0,
'y': 0,
},

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Suggested change
coords: {
'x': 0,
'y': 0,
},
coords: {
x: 0,
y: 0,
},

Comment thread src/makeRobot.js Outdated
Comment on lines +68 to +73
if (step < 0) {
return robot;
}
robot.coords['x'] += step;

return robot;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

You can rewrite like this everywhere

Suggested change
if (step < 0) {
return robot;
}
robot.coords['x'] += step;
return robot;
if (step > 0) {
this.coords.x += step;
}
return this;

@volodymyr-soltys97 volodymyr-soltys97 left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Well done 🔥

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