numberguess

A collection of the basic number guessing game in multiple programming languages. I initially wrote some of these since I found them more a lot more useful then the standard hello world example to get an idea of the most basic structure of a programming language.

Later on others contributed some more examples, if you would like to add to this list (even if there are better pages now days) please contact me on `blambi.at.chebab.com`. Only the only requirements I have is that your contribution would be under GPL v2 or another free software license and that there exists an implementation of said language that is free software.

All current implementations are licenced under GPL v2.

Python 2.x

guess.py

Perl

guess.pl

Bash

guess.sh

C (ISO C90)

How to compile: $ gcc -o guess guess.c
guess.c
Implementations: gcc, clang

C++

How to compile: $ g++ -o guess guess.cpp
guess.cpp
Implementations: gcc, clang

Haskell

How to compile: $ ghc guess.hs
guess.hs, contributed by ValarQ <vq.at.telia.com>.
Implementation: ghc

awk

guess.awk, contributed by ValarQ <vq.at.telia.com>.
Implementation: GNU awk

clisp

guess.cl
Implementations: GNU CLISP

Java

How to compile:

$ gcj -c -g -O Guess.java
$ gcj --main=Guess -o Guess Guess.o

Guess.java, contributed by shadewind <shadewind.at.gmail.com>.
Implementations: GNU Java Compiler, OpenJDK (Depends on distribution)

Tcl

guess.tcl, contributed by nymacro <nymacro.at.gmail.com>.
Implementation: tcl

ocaml

guess.ml, contributed by nymacro <nymacro.at.gmail.com> .
Implementation: ocaml

Io

guess.io, contributed by nymacro <nymacro.at.gmail.com>.
Implementation: Io

Scheme

guess.scm, contributed by ValarQ <vq.at.telia.com>.
Implementation: Guile

2014-05-26