Dart

Dart

Installation

Ubuntu
apt update
apt install apt-transport-https
sh -c 'wget -qO- https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add -'
sh -c 'wget -qO- https://storage.googleapis.com/download.dartlang.org/linux/debian/dart_stable.list > /etc/apt/sources.list.d/dart_stable.list'
apt update
apt install dart
Arch Linux
pacman -S dart

Examples

Fibonacci Numbers
// Fibonacci Numbers
int fib(int n) {
    if (n < 2) {
        return n;
    } else {
        return fib(n - 2) + fib(n - 1);
    }
}

void main(List<String> arguments) {
    int n = int.parse(arguments[0]);
    print(fib(n));
}

/*
 example
    run:
        dart fib.dart 39
*/