This program shows the shortest path between two point
Instruction:
- left click to create two points to find the shortest path (2 times)
- drag left click to draw a obsticle line
- right click to erase those two points or point from line (click/drag)
- space bar to show result
- c to clear path
- r to restart
- n to generate random obstacles
- m to generate maze
- a to use A* Algorithm
- b to use BFS Algorithm
- d to use Dijkstra Algorithm
Usage:
>> python Path.py
This program shows the shortest path between two point in the map
Using a Image_Grid.py
to create grid from map.png
Instruction:
left click to select a position and perform a shortest path
Usage:
>> python Roomba.py
This program compares the sorting algorithms
Instruction:
- Space Bar to show result
- R to reset
- A to set to ascending order
- D to set to descending order
- I to use Insertion Sort Algorithm
- B to use Bubble Sort Algorithm
- S to use Selection Sort Algorithm
- E to use Shell Sort Algorithm
- H to use Heap Sort Algorithm
- M to use Merge Sort Algorithm
- Q to use Quick Sort Algorithm
Usage:
>> python Sort.py
This program generates sudoku board and its solution
Use Sudoku_Solver.py
in utils
to solve online sudoku automatically
Note: You have 5 seconds to move your cursor to Top Left corner of the board
Usage:
>> cd utils
>> python Sudoku_Solver.py
To use GUI, please follow the instruction below:
Instruction:
- Click to select the grid
- 1-9 to sketch number and Enter to confirm
- Del to delete sketch
- I to view instruction
- C to clear all sketch
- R to reset board
- N to create new game
- Space Bar to show solution (sketch)
- ↑, →, ↓, ← to navigate through grid
Usage:
>> python Sudoku.py
Minimax algorithm: backtracking decision making to find the optimal move
Instruction:
- Click grid to place your mark (X/O)
- g to change gamemode (pvp/ai)
- 0 to change ai level to 0 (random algorithm)
- 1 to change ai level to 1 (minimax algorithm)
- r to restart the game
Usage:
>> python XO.py
This program visualizes the Container With Most Water
problem in LeetCode
Instruction:
- Type height array in Height Entry then Add to display
- New to clear all of the canvas graph and title
- Save to save plotted graph in
assets
folder - Undo to pop the last histogram
- Redo to append the last popped histogram
- Annotate to switch between on/off of histogram height visualize
- Water to switch between on/off of water container visualize
- Random Histogram to random generate (5-100) histogram's height
- Normal Distribution to generate normal distribution with random mean and std
Usage:
>> python Container.py
This program visualizes the Minimum Cost to Connect All Points
problem in LeetCode
Instruction:
- Type x array in X Entry
- Type y array in Y Entry
- Add to display minimum spanning tree
- New or Clear to clear all of the canvas graph and title
- Save to save plotted graph in
assets
folder - Undo to pop the last x, y
- Redo to append the last popped x, y
- Random MST to random generate minimum spanning tree
Usage:
>> python MST.py
This program visualizes the Regression
graph in form of linear
, non-linear
, and logistic
Instruction:
- Type x array in X Entry
- Type y array in Y Entry
- Add to display regression graph
- Save to save graph in
assets
folder - Clear to clear all of the canvas graph and title
- Select model to display in canvas graph and title
Usage:
>> python Regression.py
This program visualizes the Prime Factors
in form of bar graph
Instruction:
- Type a positive number
- Plot Factors to visualize prime number
Usage:
>> python Prime_Factor.py
This program visualizes the 8-Puzzle
solved using A* Search,
Use N_Puzzle.ipynb
to animate the solution
Instruction:
- Create an animation that illustrates each steps in solution
- Return
None
if there is no such solution 0
represents empty slot that should be in top left corner- Plot each steps in subplots
Example:
Initial state of game:
+---+---+---+
| 1 | 6 | 0 |
+---+---+---+
| 7 | 2 | 4 |
+---+---+---+
| 8 | 5 | 3 |
+---+---+---+
Expected final state:
+---+---+---+
| 0 | 1 | 2 |
+---+---+---+
| 3 | 4 | 5 |
+---+---+---+
| 6 | 7 | 8 |
+---+---+---+
Usage:
>> python Puzzle.py
This program display a list of math expression solution for every number from 0 to result using a combination of + - * / % ** //
operators and list of input numbers
Instruction:
- Enter a list of numbers (e.g., 3 7 5 9)
- Enter a result number (e.g., 10)
Usage:
>> python Math_Expression.py
Example:
Enter numbers: 3 7 5 9
Enter result: 10
0 = ((3 + (7 - 5)) // 9)
1 = ((3 + (7 + 5)) // 9)
2 = ((3 + (7 * 5)) % 9)
3 = (3 + ((7 - 5) // 9))
4 = (3 + ((7 + 5) // 9))
5 = (3 + (7 - (5 % 9)))
6 = (3 + (7 + (5 - 9)))
7 = (3 + ((7 ** 5) % 9))
8 = (((3 - 7) // 5) + 9)
9 = (((3 + 7) % 5) + 9)
10 = (3 + (7 + (5 // 9)))