CSCI 22042- Visual Programming Individual Assignment
Student Name: [Your Full Name]
Registration Number: [Your Registration Number]
Course Code: CSCI 22042
University: University of Kelaniya
Academic Year: 2024/2025 – Semester II
This project is a C# Windows Forms desktop application that visually demonstrates how sorting and pathfinding algorithms work step-by-step.
It provides interactive visualizations using GDI+ graphics and Timer-based animation, allowing users to observe how algorithms process data in real time.
The system is designed as a multi-form application with modular structure and proper separation of concerns using OOP principles.
The Sorting Visualizer allows users to observe sorting algorithms through animated bar charts.
- Visual representation using bar graphs (Panel + GDI+)
- Implements 2 sorting algorithms:
- Quick Sort
- Insertion Sort
- Step-by-step animation:
- Comparisons
- Swaps / Merges
- Color-coded states:
- Default
- Comparing
- Swapping
- Sorted
- Live comparison counter
- Generate random array
- Configurable:
- Array size
- Animation speed
- Start and Reset controls with proper state handling
The Pathfinding Visualizer demonstrates how BFS explores a grid to find the shortest path.
- Interactive grid system (Panel + GDI+)
- Implements Breadth-First Search (BFS)
- User interaction:
- Set Start node
- Set End node
- Draw wall obstacles
- Step-by-step animation of node exploration
- Final shortest path visualization
- Color-coded tiles:
- Unvisited
- Wall
- Start
- End
- Visited
- Final Path
- Error handling for invalid input (missing start/end)
- Configurable grid size and animation speed
A modal settings form used to configure both visualizers.
- Adjust array size (Sorting Visualizer)
- Adjust grid size (Pathfinding Visualizer)
- Adjust animation speed
- Values are passed dynamically to active forms
The application consists of 4 main forms:
MainForm→ Navigation screenSortingVisualizerForm→ Sorting animationsPathfindingVisualizerForm→ Pathfinding animationsSettingsForm→ Configuration panel (modal dialog)
- Language: C#
- Framework: .NET Windows Forms
- IDE: Visual Studio
- Graphics: System.Drawing (GDI+)
- Animation: System.Windows.Forms.Timer
- All algorithms implemented from scratch
- No use of built-in sorting methods (
Array.Sort,List.Sort) - No third-party visualization libraries
- Each algorithm implemented in separate classes (OOP design)
- Timer-based animation (no blocking UI threads)
- Proper validation and error handling
- Clean form lifecycle management
AlgorithmVisualizer/
│
├── Forms/
│ ├── MainForm.cs # Entry point form, navigate to visualizers
│ ├── SortingForm.cs # Sorting algorithm visualizer UI
│ ├── PathfindingForm.cs # Pathfinding algorithm visualizer UI
│ └── SettingsForm.cs # Settings for speed and grid size
│
├── Algorithms/
│ ├── Sorting/
│ │ ├── QuickSort.cs # Quick sort implementation
│ │ └── InsertionSort.cs # Insertion sort implementation
│ │
│ └── Pathfinding/
│ └── BFS.cs # Breadth-First Search implementation
│
├── Models/
│ └── Node.cs # Grid node model for pathfinding
│
└── Program.cs # Application entry point
- Clone or download the repository
- Open the
.slnfile using Visual Studio - Restore dependencies if required
- Build the solution
- Run the application (Start Debugging)
👉 Video Link: [Insert Your Demo Video Link Here]
The demo includes:
- Sorting visualizer (Quick Sort + Insertion Sort)
- Pathfinding visualizer (BFS)
- Settings form configuration
- Full animation demonstrations
- Grid interaction (walls, start, end)
- Feature-based branching used (
feature/sorting,feature/pathfinding, etc.) - Main branch always kept stable
- Pull Requests used for merging features
- Meaningful and descriptive commit messages used throughout development
- No direct commits to main after initial setup
This project is developed as an individual submission for CSCI 22042.
- All code is written independently
- Algorithms are implemented manually without external copying
- Any references used for learning are acknowledged in comments or documentation
- No direct copying from GitHub or other students
Violation of academic integrity rules is strictly avoided.
Lecturer-in-Charge (LIC): @haturusinghe
Email: shatur251@kln.ac.lk