Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Guess the language!!!

Name: Anonymous 2012-10-27 12:38

package main
 
import (
        "big"
        "fmt"
        "os"
        "strings"
)
 
func main() {
        if len(os.Args) != 2 {
                fmt.Fprintf(os.Stderr, "Usage: %s <number>\n", os.Args[0])
                os.Exit(1)
        }
 
        number_str := strings.Replace(os.Args[1], " ", "", -1)
 
        number, ok := new(big.Int).SetString(number_str, 0)
        if !ok {
                fmt.Fprintf(os.Stderr, "Failed to convert %q to big integer.\n", number_str)
                os.Exit(1)
        }
 
        os.Stdout.Write(number.Bytes())
}

Name: Anonymous 2012-10-27 13:19

Nobody here will know this awesome language.

use task::spawn;

fn fac_recur(n: int) -> int {
    if n <= 1 { 1 }
    else { n * fac_recur(n-1) }
}
 
fn fac_iter(n: int) -> int {
    // Variables must be declared with the `mut` keyword in order to be mutable.
    let mut i = 1,
            result = 1;
    while i <= n {
        result *= i;
        i += 1;
    }
    return result;
}

fn main() {
    for 10.times {
        do spawn {
            for [1, 2, 3].each |item| {
                io::println(fmt!("%d", *item));
            }
        }
    }
}

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List