-
Notifications
You must be signed in to change notification settings - Fork 10
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
added start/stop feature #8
base: master
Are you sure you want to change the base?
Conversation
@GabriFedi thanks for the PR, looks good, but it's hard for me to look at the differences as your formatter has added 4 spaces and I'm using 2. Can you revert those formatter changes and I can continue with the review? Thanks! |
@nicodelpiano try now |
Hi @GabriFedi, the code looks better! Just tested it and the Also left minor comments regarding formatter 🙏 😄 Thank you! |
@@ -26,17 +69,19 @@ function drawStep(ctx, step) { | |||
clearCanvas(ctx) | |||
let xPosition = 0 | |||
let yPosition = CANVAS_HEIGHT | |||
|
|||
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.
Please remove this
const values = step.array | ||
const [i, j] = step.swapPositions || [-1, -1] | ||
|
||
|
||
//console.log('valuse', values.entries()); |
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.
Remove the line and comment
? PIVOT_RECT_COLOR | ||
: index === j | ||
? SWAPPED_RECT_COLOR | ||
: DEFAULT_RECT_COLOR |
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.
can you rever the format that was before? see the diff on the left
const canvas = document.getElementById('myCanvas') | ||
canvas.width = CANVAS_WIDTH | ||
canvas.height = CANVAS_HEIGHT | ||
const ctx = canvas.getContext('2d') | ||
|
||
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.
rm this
@@ -115,7 +172,7 @@ document.addEventListener('DOMContentLoaded', function(event) { | |||
} | |||
}) | |||
}) | |||
|
|||
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.
rm this
@@ -60,7 +60,7 @@ function quickSortHelper(array, startIndex, endIndex, steps = []) { | |||
} | |||
swapAndTrackSteps(array, pivotIndex, rightIndex, steps) | |||
const isLeftSubarraySmaller = | |||
rightIndex - 1 - startIndex < endIndex - leftIndex - 1 | |||
rightIndex - 1 - startIndex < endIndex - leftIndex - 1 |
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.
See the diff on the left, there's two spaces identation here
No description provided.