sakhawy / PrologBits

have you considered autoerotic asphyxiation?

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

PrologBits

So, I'm studying Prolog this semester and I want to play with it a bit :)

In this repo, I'll be trying to implement some algos using Prolog. The specific implementation I'll be using is SWI-Prolog. (For a comparison between different implementations: https://en.wikipedia.org/wiki/Comparison_of_Prolog_implementations)

The files will be sorted in an alpha-numerical format, as you can see from the current structure:

  • 000_write_list_elements.pl
  • 001_list_sum.pl
  • 002_list_sum.pl
  • ...

Each file will be well-commented (won't matter cause the code is shitty anyways). And I'll break each major algo into steps before going balls deep with the implementation.

The plan is to fill this repo with the famous sorting/searching algorithms, hopefully before I get bored or kill myself cause of this shit.

Goals

  • A retarded sorting algorithm
  • Selection sort
  • Insertion sort
  • Bubble sort
  • Quicksort
  • Merge sort
  • Heap sort
  • Linear search
  • Binary search
  • Now I'm just listing random words and I know I won't be doing half of this shit but ok

DEMO/Running the programs

Just copy-paste the code to https://swish.swi-prolog.org/

About

have you considered autoerotic asphyxiation?


Languages

Language:Prolog 100.0%