Skip to content

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

2 Commits

Folders and files

Repository files navigation

🤖 Robot Simulator Pro

Headstart Bootcamp 2026 — Prep Simulator

A browser-based robot simulation environment for practicing coding, pathfinding, and algorithm design. Navigate a robot through grid-based maps, avoid hazards, collect items, and reach the goal — all by writing JavaScript code in real time.


✨ Features

Feature Description
🗺️ Built-in Maps 10+ hand-crafted maps of increasing complexity, plus random map generation
🧠 Smart Path One-click A* pathfinding — plans the optimal route and generates code automatically
🔄 Auto Optimize Brute-force optimizer that plans, runs, and adjusts until the robot succeeds
📝 Live Code Editor Powered by CodeMirror with syntax highlighting and auto-save
🎮 4 API Modes Simple, Position, Sensor, and Continuous — different skill levels
📊 Performance Stats Efficiency, path length, items collected, hazards hit
🏆 Leaderboard Best scores saved per map in your browser
🎲 Random Maps Procedurally generated maps for unlimited practice
🐢 Speed Control Adjust simulation speed from turtle to rabbit

🚀 Getting Started

Open the Simulator

Just open index.html in any modern browser. No build step, no dependencies.

Your First Run

  1. Select a map from the toolbar dropdown (or click 📂 to browse)
  2. Pick an API mode (start with simple — it's the easiest)
  3. Write code in the editor panel. Each mode exposes different commands.
  4. Click ▶ Run to execute, ⏭ Step to tick through one step at a time, or ↺ Reset to start over.

API Mode Quick Reference

Mode Commands Best For
simple moveForward(), turnLeft(), turnRight() Absolute beginners
position moveTo(x, y), turnLeft(), turnRight() Coordinate-based thinking
sensor moveForward(), turnLeft(), turnRight(), canMoveForward(), isGoal(), isHazard() Conditional logic practice
continuous move(speed), rotate(angle) Real-world robotics metaphor

🧠 Smart Path & Auto Optimize

  • Smart Path (🧠): Uses A* to find the optimal path, then generates working code for your selected API mode. Great for learning how pathfinding translates to code.
  • Auto Optimize (🔄): Runs Smart Path, executes the code, and if it fails — adjusts and retries. Repeats until success or the robot reaches the goal.

🐞 Bug Tracker

All known issues, fixes, and audit history are documented in:

➡️ ROBOT_PREP_AUDIT.html

Includes severity ratings, code references, and fix status for every bug found during the codebase audit.

Severity Count
Critical 0
High 0
Medium 0
Low 5
Fixed 14

Last audit: May 2026


🛠️ Tech Stack

Layer Technology
UI Vanilla HTML + CSS + Canvas
Editor CodeMirror 5
Pathfinding A* with hazard avoidance, path simplification
Storage localStorage (code auto-save, leaderboard)
Fonts SF Mono / Cascadia Code / Fira Code

Zero frameworks. Zero build tools. Open index.html and go.


📁 Project Structure

robot-prep/
├── index.html                  # Main app
├── style.css                   # Styles & animations
├── README.md                   # You are here
├── ROBOT_PREP_AUDIT.html       # Full bug tracker & audit
├── .gitignore
├── js/
│   ├── app.js                  # App controller (UI bindings, run/step/reset)
│   ├── maps.js                 # Map definitions (10+ levels)
│   ├── renderer.js             # Canvas renderer (grid, robot, overlays)
│   ├── simulator.js            # Simulation engine (movement, scoring, collisions)
│   ├── code-generator.js       # Generates JS code from path waypoints
│   └── map-generator.js        # Procedural random map generation
└── modules/
    ├── pathfinding.js          # A* + path simplification + multi-target planning
    ├── robot-control.js        # User-code execution sandbox
    └── strategy.js             # Smart Path planner + Auto Optimizer

📄 License

MIT — use it, learn from it, break it, fix it.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages