ricardoalmeida / polyglot

Algorithms in A, B and C

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Polyglot

Algorithms in A, B and C just for fun! _(‾◡◝ )>

Algorithm solutions in different languages

Currently supporting Go, Elixir, TypeScript (using Deno), Rust and Ruby

Method/function names are based on type of solution:

  • iterate ('for' loops)
  • recursive (Recursion)
  • pattern_match (Recursion using pattern match)
  • std (standard api)

Install (macOS)

brew update && brew install elixir deno go ruby-build

Rust:

curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
rustup update

Running all tests

make -j polyglot

Running specific tests

Golang

go test ./... -v

Ruby

bundle exec rake test TESTOPTS='-v'

Elixir

mix test

Deno & TypeScript

deno test

Rust

cargo test

Talk to Polyglot

Try this:

cd elixir
iex -S mix
iex(1)> Polyglot.hello_favorite_language()

About

Algorithms in A, B and C


Languages

Language:Go 22.8%Language:Elixir 20.7%Language:Ruby 20.4%Language:TypeScript 18.9%Language:Rust 16.8%Language:Makefile 0.4%