Interactive algorithm visualizer and code sandbox that runs fully local
Select an algorithm β watch step-by-step playback β write and execute C/C++/Java/Python code in the sandbox
- π Overview
- π― Why AlgoBuddy?
- β¨ Features
- π Architecture
- π Execution Workflow and How It Works
- π¨ UI Guide
- π Launch Instructions
- π Project Structure and Key Components
β οΈ Troubleshooting and Failsafes- π€ Author
AlgoBuddy is a premium, offline desktop application designed to bridge the gap between abstract computer science concepts and concrete execution. It functions as both a step-by-step visual debugger for algorithms and an interactive code compilation sandbox.
Watch algorithms execute visually, inspect step-by-step state changes, step backwards/forwards in execution time, and compile your own custom code in Java, C, C++, or Python using fully local, bundled compiler runtimes.
Traditional algorithm visualizers show static animations of hardcoded logic. AlgoBuddy runs your actual code and compiles custom source scripts, offline.
| Feature | Traditional Web Visualizers (e.g. VisuAlgo) | AlgoBuddy |
|---|---|---|
| Code Execution | Static pseudocode line highlighting only | Compiles & executes custom C/C++/Java/Python source code |
| Console Sandbox | None | Fully featured interactive execution console supporting real-time stdin/stdout streams, with dynamic prompt animations |
| Offline Portability | Requires active internet access | 100% offline using local compiler runtimes |
| Playback Control | Forward only or simple speed adjustment | Forward, Backward (state restore snapshots), Play/Pause, speed slider |
| Windows Launcher | None (browser-based only) | Standalone Launch4j EXE wrapping shaded JAR with local JRE and JavaFX folders |
- Granular Playback: Play, Pause, Step-Forward, and Step-Backward using state snapshot restore.
- Variable Tracker: Inspect stack states, variables, index pointers, and structural metrics in real-time.
- Adaptive Speed: Intuitive speed slider to control execution delays dynamically.
- Rich Animations: Highlight nodes, pulse edges, shake cycles, and emphasize changes on canvas.
- Offline Compilers: Bundle-ready local toolchains for GCC (MinGW), JDK (Java), and Python.
- Interactive Console: Supports interactive
stdininputs using a thread-safe blocking queue. - Syntax Highlighting: Powered by RichTextFX with dynamic token color schemes.
- Compiler Path Resolution: Dynamic parent-directory search (up to depth 5) that automatically prepends
bin/folders to environmentPATHto resolve GCC sub-process assembler (as.exe) errors.
AlgoBuddy is structured using a strict Model-View-Controller-Renderer (MVCR) architecture:
graph TD
Main[Main.java Application Entry] -->|Launches| Splash[SplashView Video Player]
Splash -->|Instant Transition| Loader{Execution Environment Check}
Loader -->|Missing Runtimes| Installer[EnvInstaller Setup Wizard]
Loader -->|Runtimes Found| Dash[Main Dashboard View]
Dash -->|Select Algorithm| AlgView[AlgorithmViewController Template]
AlgView -->|Coordinates| Solver[Algorithm Step-Solver]
AlgView -->|Renders State| Visual[Canvas/Pane Renderer]
Dash -->|Code Sandbox Playground| Editor[RichTextFX Code Editor]
Editor -->|Executes Code| Executor[CodeExecutor Temp Sandbox]
Executor -->|Prepend Bin Path| PATH[Process Environment PATH]
PATH -->|Interactive Console Stdin/Stdout| StdinQueue[InteractiveConsolePane Queue]
ASCII fallback (click to expand)
[Main.java Application Entry]
β
(Launches)
βΌ
[SplashView Video Player]
β
(Instant Transition)
βΌ
{Execution Environment Check}
/ \
(Missing Runtimes) (Runtimes Found)
/ \
βΌ βΌ
[EnvInstaller Setup Wizard] [Main Dashboard View]
/ \
(Select Alg) (Run Code Sandbox)
/ \
βΌ βΌ
[AlgorithmViewController] [RichTextFX Code Editor]
/ \ β
(Solver) (Canvas) (Executes Code)
/ \ βΌ
[Algorithm Solver] [Visual Renderer] [CodeExecutor Temp Sandbox]
β
(Prepend bin to PATH)
βΌ
[Interactive Console]
- Startup: The application launches, instantly showing the
SplashViewvideo animation running at1.5xspeed. - Environment Scan:
ExecutionEnvironmentperforms a quick local path query. If local runtimes are missing, theEnvInstallersetup wizard pops up to let users download runtimes. - Dashboard / Visualizer Selection: The user selects an algorithm from the category grid.
- Playback Thread Loop: The
AlgorithmViewControllermanages a timeline callback. At each tick, it asks the solver tostep()once, updates variables, and commands the canvas renderer to draw the current frame. - Snapshot Save/Restore: To support stepping backwards, each
step()call takes a clonesnapshot()of all solver state variables. If the user steps back, the controller restores the solver to a previous state frame.
The gateway screen containing a category grid (Searching, Sorting, Graphs, Dynamic Programming, Puzzles, etc.) with a live-filtering search bar.
The main visualization panel holding the animation canvas, pseudocode sidebar, playback buttons, variable tracking table, and speed slider.
A split-screen layout featuring a code editor with line numbers and syntax highlighting alongside a live stdin/stdout terminal panel.
A package downloader wizard with progress bars showing compiler extraction status for GCC (MinGW), Java JDK, and Python.
- Java Development Kit (JDK) 11 or higher.
- Apache Maven 3.6+.
# Compile and run JavaFX application
mvn clean compile
mvn javafx:runTo launch the packaged release version:
- Ensure the
jre/and OpenJFX SDK (openjfx-21.0.7_windows-x64_bin-sdk/) folders are located in the application root directory alongside the executable (provided in release distributions). - Double-click
AlgoBuddy.exe. No system Java setup or installation is required!
Launch4j configuration properties can be customized locally.
| Path | Purpose |
|---|---|
src/main/java/com/algorithmvisualizer/Main.java |
App entry point and window manager |
src/main/java/com/algorithmvisualizer/execution/ExecutionEnvironment.java |
Scans local folders for compiler runtimes |
src/main/java/com/algorithmvisualizer/execution/CodeExecutor.java |
Sandboxes compilation & routes subprocess paths |
src/main/java/com/algorithmvisualizer/ui/MainController.java |
Category selection dashboard controller |
src/main/java/com/algorithmvisualizer/ui/AlgorithmViewController.java |
Central template for visualizers and playback controls |
src/main/java/com/algorithmvisualizer/ui/SplashView.java |
Manages 1.5x sped-up video logo reveal |
src/main/java/com/algorithmvisualizer/ui/EnvInstallerController.java |
Setup wizard downloader for compilers |
src/main/resources/fxml/ |
FXML layout views for all panels |
src/main/resources/css/style.css |
Premium styling stylesheets and dark-mode tokens |
| Expected Error | Cause | Solution |
|---|---|---|
CreateProcess: No such file or directory (GCC as error) |
GCC assembler (as.exe) missing from environment search path |
Handled dynamically by CodeExecutor automatically prepending the compiler's bin/ folder to the runtime process environment PATH. |
IllegalAccessError in splash video |
javafx.media module missing from JRE module path |
Fixed by adding javafx.media to the --add-modules JVM options in the Launch4j JRE configuration. |
ZipException during installation |
ZIP extraction fails due to central directory header mismatches | Resolved by using random-access ZipFile parser instead of sequential ZipInputStream. |
| Missing local runtimes | Runtimes not downloaded or placed in directory root | Run the built-in Setup Wizard installer to download and unpack compilers automatically. |
- Code Execution Sandbox: Limits running processes to a maximum 10-second timeout to prevent infinite loops.
- Codec Fallback: If media engines or codecs are missing, the splash view catches exceptions and falls back to loading the dashboard immediately.
Felix-au (Harshit Soni)
- π GitHub: github.com/Felix-au
- π§ Email: felixaugum@gmail.com
Interactive learning that brings code to life, offline.
