-
-
Notifications
You must be signed in to change notification settings - Fork 359
Bubble Sort Scratch Implementation #610
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
Bubble Sort Scratch Implementation #610
Conversation
Bubble sort usually sorts from smallest to largest, you should invert your logic. In the error you showed there is a space in the path |
That's an error when copying, because I directly copied from the console. No space in the folder. |
Ok, I'll invert the logic(ascending) |
The scratch implementation that has been submitted is a png image that seems to have been saved as an svg. I don't mind png images in the algorithm archive, so feel free to use a png instead of svg. Could you also increase the quality of the image used? |
wait, I just find the way to generate in |
f4f4ed7
to
9532eb8
Compare
OK, although I put a .svg generated from the tool @jiegillet used
|
afa84b5
to
3bb1aad
Compare
3bb1aad
to
f8aaa63
Compare
All the scratch right now is in scratch2, but it is possible to output scratch3 with this: https://s3blocks.github.io/generator/ (use the export svg button). I would guess scratch3 would be better for this. You can get to this site by clicking the "scratchblocks" link in the upper left of the link you posted. Would you also be able to commit the scratchblocks code used to generate this so we can generate it again in the future if there is a change to scratch (scratch4). @jiegillet Is it possible to find the scratchblocks code you used for the scratch2 implementations? |
Do you mean the code in text form? I'm afraid I dropped the ball and lost it, I should know better than to get rid of source code :( |
It's equally my fault for not asking for it at the time. I suppose we should use scratch3 for this one? |
I think I deleted it even before sending the PR, nothing you could have done. I now think the code in text form should also be committed along with the svg (but should not be included in the Yes, we should use Scratch 3 from now on! Maybe I'll update my Scratch svgs in the future! |
well, how to include the scratchblock? just .txt? |
Yeah, please add a text document next to the svg image |
Crap. I tried to generate in scratch 3, the picture does show on site, but when I click "Export SVG", nothing happened. "Export PNG" makes a file that I can't open. When I directly save the picture, it becomes all black. |
I put a PR to your branch with the svg. It worked fine on my end. |
changing to svg
@leios sorry, but I found that I accidently added one more
|
I am not really sure why the svg option is not working for you |
09aba21
to
39a04e5
Compare
Phew. By some strange way, I finally get the correct svg picture. |
This isn't totally necessary, but it could be nice to change the variable names to match the other implementations |
- Indent - add Scratch textCode into .editorconfig
Thanks, but as mentioned before, I can't generate .svg here (may be caused by Edge), so I can't make change. |
hmm... I think I know how to make correct svg here.
so if I add it in the end of <def> label, the image looks fine. |
I am relatively happy with the code and am almost ready to merge it. The only problem I have is that the BubbleSort function cannot take the list If so, there is nothing we can do and I'm willing to merge now. |
Yeah, we can't take lists as a variable. |
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.
This is as close as we can come to the other implementations in scratch, so I approve.
In the building, I met a strange problem:
It can't pass. It said
what? Line 1605?
Also, I tried to paste the code of tree traversal here(with ../tree_traversal), but still fail.