Skip to content

Flood fill in Javascript using p5.js #748

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

Closed
wants to merge 2 commits into from

Conversation

0xJonas
Copy link
Contributor

@0xJonas 0xJonas commented Sep 2, 2020

Implementation of flood fill using the p5.js framework.

I thought it would be nice to have a more visual showcase of the algorithms and p5.js makes this very easy.
If using p5.js is not acceptable, I'm fine with redoing it in node.js in a similar way to the Julia/C implementations. The actual algorithms can stay the same either way.

Link to the p5 sketch: https://editor.p5js.org/delphi1024/sketches/flzb29W1o

@leios
Copy link
Member

leios commented Sep 10, 2020

To be honest, we haven't really decided what to do with p5.js yet. There is another PR open that didn't really get anywhere on this topic where we were split on whether p5 was a new language or not.

I will say that to merge this PR, I would like to see the code closer to the other implementations. We used Float64 values and chose the example for pedagogical reasons.

I am definitely up for discussion here!

@0xJonas
Copy link
Contributor Author

0xJonas commented Sep 11, 2020

I think that an algorithm like flood fill benefits greatly from a graphical output, especially if the language supports this without too much boilerplate code. p5.js is one way to do it and, since it also has a web-based editor, one can try out and experiment with a sketch very quickly.

On the other hand I understand that it is a good idea to keep the implementations consistent across languages, including possible testing code. Using external libraries in general might also be an issue (if they are not related to the algorithm) since these certainly won't be the same across languages.

I am interested to see where this is going as well. In the meantime, I submitted the code again using node.js in a separate PR (#752), so that there is a JS implementation which is more similar to the already existing implementations.

@berquist berquist added the Implementation This provides an implementation for an algorithm. (Code and maybe md files are edited.) label Oct 3, 2020
@ntindle
Copy link
Member

ntindle commented Aug 28, 2021

[lang: javascript]

@github-actions github-actions bot added the lang: javascript Javascript programming language label Aug 28, 2021
@Amaras
Copy link
Member

Amaras commented Dec 8, 2021

Hi @0xJonas, thank you for your PR.

On the other hand I understand that it is a good idea to keep the implementations consistent across languages, including possible testing code. Using external libraries in general might also be an issue (if they are not related to the algorithm) since these certainly won't be the same across languages.

Since 2020, we have decided we need to work on an output validation system (if you have not followed closely), so I am not sure if p5.js is a good idea for this indeed.
I'll let you the judge of if we need to close this PR 😉

@0xJonas
Copy link
Contributor Author

0xJonas commented Dec 8, 2021

Yeah, p5.js is definitely not suited well for automatic output validation. I'll close this PR.

@0xJonas 0xJonas closed this Dec 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Implementation This provides an implementation for an algorithm. (Code and maybe md files are edited.) lang: javascript Javascript programming language
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants