Skip to content

akshatshukla13/nQueenVisualiser

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

2 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

โ™› N-Queens Visualizer

A visual representation of the classic N-Queens problem built using vanilla JavaScript, HTML, and CSS. This tool lets you visualize how queens are placed on an N x N chessboard such that no two queens threaten each other, with interactive controls for board size, speed, and step-by-step tracing.


๐Ÿ”— Demo

(Deployed on Vercel)


๐Ÿš€ Features

  • ๐ŸŽฏ Board Size Selector (4โ€“15)
  • ๐Ÿข Adjustable Speed Slider for visualization delay
  • โฏ๏ธ Start, Pause, Resume, and Reset controls
  • ๐Ÿ“ˆ Live step counter and solution counter
  • ๐Ÿ“ฆ Multiple solutions preview
  • ๐Ÿ’ก Backtracking algorithm implementation

๐Ÿง  Tech Stack

  • HTML/CSS โ€“ UI and layout
  • JavaScript (ES6+) โ€“ Logic and DOM manipulation

๐Ÿงฉ Controls

Control Description
Board Size Input a number from 4 to 15
Speed Slide to increase/decrease animation speed
Start Begin solving the N-Queens problem
Pause Temporarily halt the algorithm
Resume Continue from where it was paused
Reset Clear the board and all solutions

๐Ÿงฎ Algorithm

The visualizer uses a backtracking algorithm:

  • Places one queen per row.
  • Checks for safe positions using row, column, and diagonal checks.
  • Visual feedback is shown for each validation step.

๐Ÿ“š Learnings

  • DOM manipulation with dynamic elements
  • Handling async/await and delays
  • State management (pause/resume/reset)
  • Visualizing backtracking algorithms

๐Ÿง‘โ€๐Ÿ’ป Author

Akshat Shukla GitHub | LinkedIn


๐Ÿ“„ License

MIT License โ€“ feel free to use and modify!


Let me know if you'd like this customized further (e.g., to match a GitHub repository URL or add deployment instructions).

Releases

No releases published

Packages

No packages published