(BETA) feat: Add multiple language support with code samples for algorithms#3
Open
xWickz wants to merge 1 commit intomidudev:mainfrom
Open
(BETA) feat: Add multiple language support with code samples for algorithms#3xWickz wants to merge 1 commit intomidudev:mainfrom
xWickz wants to merge 1 commit intomidudev:mainfrom
Conversation
|
@xWickz is attempting to deploy a commit to the midudev pro Team on Vercel. A member of the Team first needs to authorize it. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
alg0.dev is a website featuring algorithms ranging from basic to advanced programming levels. These concepts are very important and fundamental when it comes to competitive programming: programming marathons, Leetcode, etc. That is why it is important to have these examples in multiple programming languages, including the most commonly used languages in competitive programming, which are usually C++ or Java. This is why the problem or idea of proposing a feature that contains codes in other languages arises
Solution
Multiple languages have been developed for code visualization, with five available: JavaScript (default), TypeScript, Python, C++, and Java. You can switch between these codes in the algorithms to understand and visualize how it would look in other programming languages. This helps not only to take it into account in other languages but also to have the reference at hand on the same page without having to use AI or other tools/methods to change the JavaScript code to another desired one, which boosts the page even more
Testing
Changing to another language

Available Algorithms to Test
How to add new or more languages
CodePanel.tsx (to add or remove languages)
Algorithms (Folder) — sorting.ts
We got bubbleSort for example, default code is:
For example, if we would like to add C++ language example, it would be this way: