Skip to content
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

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

GabriFedi
Copy link

No description provided.

@nicodelpiano
Copy link
Owner

@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!

@GabriFedi
Copy link
Author

@nicodelpiano try now

@nicodelpiano
Copy link
Owner

Hi @GabriFedi,

the code looks better! Just tested it and the stop button works great, but I'm unable to restart or to play it again. Can you add that continue functionality to your work?

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

Copy link
Owner

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());
Copy link
Owner

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
Copy link
Owner

@nicodelpiano nicodelpiano Oct 8, 2019

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')

Copy link
Owner

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) {
}
})
})

Copy link
Owner

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
Copy link
Owner

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

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