Skip to content

Short code snippets for doing various things in various languages. Just examples, really.

License

Notifications You must be signed in to change notification settings

omgmajk/different-languages

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

different-languages

Tutorial/Examples

This is just a project for learning various languages and their syntax and tools, over the years I have seen various questions about these things on Stack Overflow and Reddit and I thought I'd try my hand at generating a bunch of examples. This readme-file is a mess and the languages and install instructions are added as I add more languages. In the future I will format it better but I'm still thinking of code examples I can make.

Code examples for taking user input from console and displaying it back

Featured language examples:

  Assembler x64
  Ada             Common Lisp
  Bash            Lua
  C               Nim
  C#              Perl
  C++             PHP
  Elixir          PowerShell
  Fortran (GNU)   Python 3
  FreePascal      Ruby
  GoLang          Rust
  Haskell         Scala      
  Java            SmallTalk (GNU)
  JavaScript      VB.NET
  Julia

Code examples for random number generation

Featured language examples:

  Ada             Common Lisp
  Bash            Lua
  C               Nim
  C#              Perl
  C++             PHP
  Elixir          PowerShell
  Fortran (GNU)   Python 3
  FreePascal      Ruby
  GoLang          Rust
  Haskell         Scala      
  Java            SmallTalk (GNU)
  JavaScript      VB.NET
  Julia

Code examples for FizzBuzz problem

Featured language examples:

Ada             Common Lisp
Bash            Lua
C               Nim
C#              Perl
C++             PHP
Elixir          PowerShell
Fortran (GNU)   Python 3
FreePascal      Ruby
GoLang          Rust
Haskell         Scala      
Java            SmallTalk (GNU)
JavaScript      VB.NET
Julia

Code examples for recursive functions / factorial

C               Rust
C++

Languages to add

Zig, Prolog, Erlang, Never, Forth, Red, Crystal, Dart, Perl6/Raku, D, Clojure

Legacy, languages removed from the different example programs

Basic-256/Qbasic    
R

Install guide Kali Linux

Note: these installation packages will most likely work in Debian and Ubuntu as well.

If you use Debian, Ubuntu, Kali and so on full install:
$ sudo apt install kali-linux-large

In that case: nasm, go, gcc, js, java, python3, perl, php and ruby might be pre-installed.
Otherwise find these packages.

These might need to be installed:
Install Ada: $ sudo apt install gnat-10
Install Haskell: $ sudo apt install ghc
Install Common Lisp: $ sudo apt install clisp
Install Lua: $ sudo apt install lua5.4
Install Scala: $ sudo apt install scala
Install Smalltalk: $ sudo apt install gnu-smalltalk
Install Rust: $ sudo apt install rustc
Install Basic256: $ sudo apt install basic256
Install Nim: $ sudo apt install nim
Install Go: $ sudo apt install golang
Install Fortran: $ sudo apt install gfortran
Install Free Pascal: $ sudo apt install fp-compiler-3.2.0
Install Julia: $ sudo apt install julia

For the rust rand program to compile/work you might need:
$ sudo apt install librust-rand-dev libssl-dev
$ cargo install cargo-edit

Add /home/<youruser>/.cargo.bin to path:
$ nano /home/<youruser>/.bashrc

ADD this line to the end of the file:
export PATH="/home/<youruser>/.cargo/bin:$PATH"

Start PowerShell by typing: $ pwsh

Interactive shells

C#, like Python offers an interactive shell. You start it by typing csharp in your console, just like idle or python3

Feel free to comment or add suggestions for more languages.

About

Short code snippets for doing various things in various languages. Just examples, really.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published