Giter Club home page Giter Club logo

erlang-99's Introduction

99 Problems but Erlang ain't one

Introduction

The 99 Prolog Problems were formulated many years ago by a teacher working at the University of Applied Sciences in Biel-Bienne, Switzerland. They were meant to teach students how to think in a way that is compatible with logical programming, allowing them to improve their skills in the process.

While functional programming isn't logical programming and Erlang is not Prolog, it used to be based on it and the syntax has remained quite similar*. Therefore I have decided to solve the 99 problems using Erlang.

Problems

I am solving the remade problems as they are stated on this page. The solutions are grouped into categories, starting with lists and ending at graphs.

Solutions

The solutions will be grouped into modules according to the categories mentioned in the previous section.

Testing

To test the functions you can compile and run them from the Erlang shell. An example of doing so:

$ erl
1> c(list_prb).
{ok,list_prb}
2> list_prb:reverse([1,2,3]).
[3,2,1]

Once I'm done with all the problems I will consider writing unit tests for all functions.

Progress

  • List problems - done, available in the file list_prb.erl.
  • Arithmetic problems - done, available in the file arith_prb.erl.
  • Logic and Codes problems - done, available in the file logic_prb.erl.
  • Binary Tree problems - started, in tree_prb.erl.

Final words

I hope that these solutions will be of inspiration to someone who, like me, decides to learn Erlang.



* I must admit, however, that reading Prolog code I can mostly see what it is suggesting but I don't have a clue how it does what it does :)

erlang-99's People

Contributors

jepio avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.