-
Notifications
You must be signed in to change notification settings - Fork 9.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Complete Lab #26
base: master
Are you sure you want to change the base?
Complete Lab #26
Conversation
There was a problem hiding this 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){ |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
block or blockNum?
There was a problem hiding this comment.
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; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
return feet * 264; | |
return feet * 264; |
let block; | ||
if (start > destination) { | ||
block = start - destination; | ||
} else { | ||
block = destination - start; | ||
} return block * 264; |
There was a problem hiding this comment.
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.
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) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
} else if (distanceAfterFreeRide >= 1600 && distanceAfterFreeRide <= 2100) { | |
} else if (distanceAfterFreeRide <= 2100) { |
No description provided.