This repository is a comprehensive collection of diverse Prolog programming challenges designed to enhance your understanding and proficiency in Prolog. Whether you are a beginner looking to learn the basics of Prolog or an experienced programmer aiming to refine your skills, this repository provides a wealth of problems and projects to explore.
1. Introduction
2. Installation
4. Usage
5. Contribution
6. License
This repository is designed for those interested in learning Prolog by working through practical examples. Each project is self-contained and includes a clear description of the problem, the Prolog code to solve it, and instructions on how to run the code. Whether you are a beginner or an experienced developer, you will find valuable insights and challenges in these projects.
To get started with the projects in this repository, you will need to have Prolog installed on your machine.
Follow the steps below to set up your environment:
- Install SWI-Prolog:
- Visit the SWI-Prolog website and download the installer for your operating system.
- Follow the installation instructions provided on the website.
- Clone this repository:
* git clone https://github.com/jElhamm/100-Projects-for-Prolog
* cd 100-Projects-for-Prolog
5. Converting Binary to Decimal
6. Converting Decimal to Binary
7. Calculating Fibonacci Numbers
8. Generate Prime Numbers up to N
9. Calculate the Least Common Multiple (LCM)
10. Calculate the Greatest Common Divisor (GCD)
14. Checking Graph Homomorphism
15. Check if a Graph is Connected
16. Finding Minimum Spanning Tree
17. Find All Paths Between Two Nodes
18. Convert a Directed Graph to an Undirected
19. Reverse
20. Find Max
21. Find Min
22. Sum List
23. Is Sorted
24. List Length
25. Add Element
26. Check Equality
27. Append Two Lists
28. Average Elements
29. Check Membership
39. Find Second Largest Element
40. Delete Occurrences Elements
41. Find Second Smallest Element
42. Longest Sublist with No Duplicates
43. Matrix Trace
44. Identity Matrix
45. Matrix Addition
46. Transpose Matrix
47. Matrix Inversion
58. Smallest Element in Matrix
59. Sum of Odd Numbers in Each Row
60. Sum of Even Numbers in Each Column
61. Reversing String
70. Extract Numbers from String
71. Check Two Strings are Equal
72. Counting the Number of Words
73. Convert a List of Characters
74. Removing Duplicate Characters
75. Checking String is Palindrome
76. Finding the Length of a String
77. Counting Characters in a String
78. Converting Lowercase Letters to Uppercase
79. Converting Uppercase Letters to Lowercase
80. GraphPathFinder
81. Shell Sort
82. Quick Sort
83. Merge Sort
84. Bubble Sort
85. Insertion Sort
86. Selection Sort
87. Binary Search
88. Linear Search
89. Detect Cycles in a Directed
90. Find the K-th Smallest Element
91. Find the Last Duplicate Element
92. Find the First Duplicate Element
93. Calculate Mean
94. Calculate Mode
95. Calculate Range
96. Calculate Median
100. Calculate Standard Deviation
Each project is contained within its respective folder. To run a project, follow these steps:
- Navigate to the project folder:
cd Project-Name
- For example, to navigate to the project for calculating the mean:
cd Statistics_and_Probability/Calculate_Mean
- Open the Prolog file in SWI-Prolog:
swipl project_name.pl
- For example:
swipl mean.pl
- Follow the instructions in the project file to execute the code.
- Please fork the repository, make your changes, and submit a pull request.
- Ensure your code adheres to the existing style and includes relevant tests.
- For detailed guidelines, check the project's issues or discussions.
This repository is licensed under the MIT License.
See the LICENSE file for more details.