Skip to content

[OTHER]: Online client-side playground with test runner #264

@hatemhosny

Description

@hatemhosny

What would you like to share?

Great project, thank you!

I want to share with you an online, client-side playground that I have created for the algorithms in this project. It imports code implementations from the repo and runs the tests.

Demo: https://hatemhosny.github.io/thealgorithms-javascript

Code can be edited in the code editor (using Monaco on desktop and CodeMirror6 on mobile). The code runs in the browser (in a sandboxed iframe), with no need for a backend. Test runner is available, which runs the tests in the browser using Jest.

Direct links to a specific algorithm are supported. When a new algorithm is selected from the dropdown menu, the URL querystring parameter algorithm is changed to the selected one. This URL can be shared and the selected algorithm will be loaded by default. e.g. https://hatemhosny.github.io/thealgorithms-javascript/?algorithm=Recursive/Factorial

Clear Links to your project are added (in the project GitHub repo, the deployed page and in imported code) as indicators for the source of the implementations and tests.

The source code for my project can be found here: https://github.com/hatemhosny/thealgorithms-javascript.

This playground is built using LiveCodes, a feature-rich, open-source, client-side code playground that supports 80+ languages/frameworks. The playground is embedded in the page using LiveCodes SDK.

Disclosure: I am the author of LiveCodes.

I'm just letting you know about the project and thanking you for such a great resource. If you think LiveCodes can be useful in the official website or for direct links to run samples in the repo, please let me know. If you want to change the UI of the playground, LiveCodes SDK has a headless mode which can give you full control over the UI, maintaining the ability to communicate with the playground using various SDK methods (e.g. for running code or tests and getting console output and test results). In addition, if you require extra features, I'm open for discussion.

Of course, feel free to close this issue whenever you feel suitable.

Additional information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions