|
1 | | -# Writer of this code: |
| 1 | +# Written by |
2 | 2 | # Seyyed Ali Shohadaalhosseini |
3 | 3 |
|
4 | 4 | # We'll never forget that: |
|
41 | 41 | Enter ASTAR as A Star Search\n |
42 | 42 | Enter GREEDY as Greedy Search\n |
43 | 43 | Enter HILL as Hill Climbing Search: \n |
44 | | - Enter the name here: """) |
| 44 | + Enter the name here: """).lower() |
45 | 45 |
|
46 | | - if WhichAlgorithm == "DFS": |
| 46 | + if WhichAlgorithm == "DFS".lower(): |
47 | 47 | print(Search.searchDFS(initialState, GoalState)) |
48 | 48 |
|
49 | | - elif WhichAlgorithm == "BFS": |
| 49 | + elif WhichAlgorithm == "BFS".lower(): |
50 | 50 | print(Search.searchBFS(initialState, GoalState)) |
51 | 51 |
|
52 | | - elif WhichAlgorithm == "DLS": |
| 52 | + elif WhichAlgorithm == "DLS".lower(): |
53 | 53 | print(Search.searchDLS(initialState, GoalState, 28), sep=" === > \n\n") |
54 | 54 |
|
55 | | - elif WhichAlgorithm == "IDS": |
| 55 | + elif WhichAlgorithm == "IDS".lower(): |
56 | 56 | print(Search.searchIDS(initialState, GoalState), sep=" === > \n\n") |
57 | 57 |
|
58 | | - elif WhichAlgorithm == "UCS": |
| 58 | + elif WhichAlgorithm == "UCS".lower(): |
59 | 59 | print(Search.searchUCS(initialState, GoalState), sep=" === > \n\n") |
60 | 60 |
|
61 | | - elif WhichAlgorithm == "ASTAR": |
| 61 | + elif WhichAlgorithm == "ASTAR".lower(): |
62 | 62 | print(Search.searchAstar(initialState, GoalState), sep=" === > \n\n") |
63 | 63 |
|
64 | | - elif WhichAlgorithm == "GREEDY": |
| 64 | + elif WhichAlgorithm == "GREEDY".lower(): |
65 | 65 | print(Search.searchGreedy(initialState, GoalState), sep=" === > \n\n") |
66 | 66 |
|
67 | | - elif WhichAlgorithm == "HILL": |
| 67 | + elif WhichAlgorithm == "HILL".lower(): |
68 | 68 | print(Search.searchHillClimbing(initialState, GoalState), sep=" === > \n\n") |
69 | 69 |
|
70 | 70 | ans = input("Do you want to continue ? y/n ") |
0 commit comments