Foo

Foo is an esoteric programming language, created by User:Feky in February 2008. It is inspired mainly by Brainfuck.

Memory
Foo programs are supplied with a one-dimensional array of X elements (cells, whatever), where each element can hold a value from 0 to 65535. The array pointer wraps around when it exceeds the number X, and points to the first element in the array. All elements in the array are initialized to zero on the start of the program. There's also a stack to help with arithmetic operations and various copying operations, which can also have a custom number (X) of elements, and the value of each can vary from 0 to 65535. Conditional jumps (loops) are also controlled using a stack, that is limited to the number of maximum nested loops.

Operators
Foo is capable of doing basic arithmetic operations (of course), measuring the time (in seconds, and larger units), controlling the flow of execution and outputting values. Foo programs end when the interpreter reaches.

Example code
The simplest Hello World program: "Hello, World!"

Double an integer and print it: &256*2$i

Countdown loop: &10(0#1-1$i$c10)"boom!"$c10

Infinite loop: (1)

Negative numbers: &30@50-@&65535-+1$i

Factorial calculator (works if the number is less than 9): &4>&1<(0@-1>*<)>$i

Decimal to binary converter (big-endian order): &255(0@>&%2$i>>(20<<@>+<<@>>+<<@>&>@<<&>>$i$c32&0>+1)

4-dimensional loop: (4+1"Time: "$i$c10>(6+1>(3+1>(3+1$i$c32)&0<$c10)&0<$c10)&0<)

99 bottles of beer (Without support for singular form of "bottles"): &100(1 -1 $i " bottles of beer on the wall, " $i " bottles of beer." $c10 -1 "Take one down and pass it around, " $i " bottles of beer on the wall." +1 $c10$c10) "No more bottles of beer on the wall, no more bottles of beer." $c10 "Go to the store and buy some more, 99 bottles of beer on the wall."$c10$c10

External resources

 * A Foo interpreter written in C