Flip is an esoteric programming language apparently designed and implemented in 2001 by Rune Zedeler and Erik Søe Sørensen. The official home page of Flip is http://www.daimi.au.dk/~eriksoe/Flip/. It is a two dimensional language in which multiple balls, each holding a 32-bit integer, roll around a grid, interacting with various elements in the grid. Here is a fairly concise "Hello, World!" program based on an octal encoding.
\@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ PQ \,\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ + \ @ /+*</ / \/- @101154145145175045004172175126145144014021- @8@8@ @ X <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<</ \ < < \< /- \ \/ @ @
A full description of the language can be found at the Flip homepage (link above) as well as an interpreter (in Java), although this interpreter lacks two features which are mentioned in the description; input and levels. I have written two interpreters of my own which support all features of the language. The older, C++ version can be found at my downloads page. The newer interpreter is in Javascript and runs within a web browser. It is used in the following pages:
- All sample programs from the Flip language description
- All programs from the Flip homepage's collection
- Some of my own programs
- Editor to write your own programs or run programs copied from elsewhere
The interpreter itself can be found here.
Here are some programs I have written in Flip.
- The Hello, World! program shown above.
- A quine (self-replicating program).
- HELLO! and Hello, World! 'tickers'. These programs produce no output, but display the relevant phrase moving across the screen as part of the execution. A C++ program is available to create such effects; it reads a text file as the image to reproduce and outputs a flip program to display it.
- A program which prints the lyrics to "99 bottles of beer". This is particularly fun to watch in action (which you can do from the "Some of my own programs" link, above).
- Here is a brainfuck to Flip translator, in C. This provides a proof that Flip is turing-complete. It was inspired by the language description's claim that levels make the language turing-complete by allowing the emulation of a stack. This code uses two such stacks to emulate the brainfuck tape. It is also a spectacularly slow way to run a brainfuck program.
- A rather compact prime number calculator, complete with a breakdown of its operation.