Skip to content

Conversation

@cmhorsey
Copy link

@cmhorsey cmhorsey commented May 6, 2024

No description provided.

Copy link

@stephenmckeon stephenmckeon left a comment

Choose a reason for hiding this comment

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

Just a few small things, but overall great job.

@@ -1 +1,38 @@
// Code your solution in this file!
function distanceFromHqInBlocks(num1){

Choose a reason for hiding this comment

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

What do you think a better name for the argument num1 could be?

Copy link
Author

Choose a reason for hiding this comment

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

block or blockNum?

Choose a reason for hiding this comment

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

Either would be good! I like blockNumber or even startingBlockNumber since it's most descriptive.


function distanceFromHqInFeet(num) {
let feet = distanceFromHqInBlocks(num);
return feet * 264;

Choose a reason for hiding this comment

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

Suggested change
return feet * 264;
return feet * 264;

Comment on lines +16 to +21
let block;
if (start > destination) {
block = start - destination;
} else {
block = destination - start;
} return block * 264;

Choose a reason for hiding this comment

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

Since you're not doing anything with the block, you don't need to assign it to a constant.

Suggested change
let block;
if (start > destination) {
block = start - destination;
} else {
block = destination - start;
} return block * 264;
if (start > destination) {
return start - destination;
} else {
return destination - start;
}

return 0;
} else if (distanceAfterFreeRide < 1600) {
return distanceAfterFreeRide * 0.02;
} else if (distanceAfterFreeRide >= 1600 && distanceAfterFreeRide <= 2100) {

Choose a reason for hiding this comment

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

Suggested change
} else if (distanceAfterFreeRide >= 1600 && distanceAfterFreeRide <= 2100) {
} else if (distanceAfterFreeRide <= 2100) {

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