git @ Cat's Eye Technologies Befunge-93 / example-licensing-updates eg / README.markdown

Tree @example-licensing-updates (Download .tar.gz)

README.markdown @example-licensing-updatesview markup · raw · history · blame

Befunge-93 Example Programs

Entries which have a CC0 in the License column are in the public domain, under the Creative Commons CC0 Public Domain Dedication. All others are freely redistributable in this archive, but remain copyrighted by their original authors. See the file LICENSE for more information.

NOTE: in the interests of improving the general experience of exploring these examples, some buggy and/or bitrotting examples have been removed in the 2.25 release. Refer to the 2.24 release if you wish to find them.

NOTE: many of these programs were developed on interpreters that did not produce warnings. When running them with bef it is recommended to suppress extraneous output with bef -q.

NOTE: dates are given in Month/Day/Year Minus 1900 format, and many of these dates are questionable, especially when Day is 1.

Name License Author Date Notes Kalyna Zazelenchuk 9/5/93 This program will input a string of sixteen characters or less, and (p)ut those characters in order on line 3 (the line with the *'s). It will then randomly find numbers from 1 to 16, (g)et the characters at line 3 in random order, replace them with *'s, and print them out. Effectively produces anagrams of words you type in. It uses the code from '' to generate random numbers. CC0 Andrew Turley 10/30/97 aturley's .sig; cellular automata gasket generator. Kevin Vigor 4/9/97 A simple program that prints the "beer song" (99 bottles of beer on the wall...) from 99 down to 0. Does not get the lyrics exactly right, but I think we can assume that's because it's had a few. Part of the Beer Song archive. Chris Lahey 6/8/97 A squashed (22x10) beer singing program, gramatically correct. Keith Arner 4/10/97 Another "99 Bottles of Beer" program. Chris Lahey 4/11/97 Another singing algorithm. Denis Moskowitz 4/11/97 Yet another singing algorithm. David Johnston 4/11/97 Another singing program. Chris Lahey 4/11/97 A crammed (14x21) singing program. CC0 Wim Rijnders 5/2/97 A beer bottling program. CC0 Wim Rijnders 5/12/97 Again with the bottles. David Johnston 5/13/97 Crammed (22x9) singing beer program which doesn't use good grammar or punctuation. CC0 Wim Rijnders 5/12/97 A small subset Befunge-93 interpreter written in Befunge-93. Barely smart enough to execute the helloworld program within the #-delimited block. Runs like a cow. This is the second revision (ca. 2000?) which has some bugs (pointed out by Amir Karger) fixed. Denis Moskowitz 7/17/97 Befunge logo source. Sam Holden 7/17/97 Befunge logo source. CC0 Ben Olmstead 7/18/97 Befunge logo source. Kevin Vigor 8/13/97 Befunge logo source. Kevin Vigor 7/18/97 Non-standard (oversize) Befunge logo source. Bryan L 4/10/97 This is a befunged calculator. Meaning ".", the print command, will also pop the result off the stack. Fortunately, the duplication command ":" is supported. This calculator will blithely ignore anything that isn't a number or a supported command. The list of commands is found on line 3. CC0 Chris Pressey 7/20/97 Like, but continues to replicate itself. Kalyna Zazelenchuk 9/5/93 Generates a printable ASCII table, with characters and corresponding codes in decimal, from 34 to 127. ??? ?/?/9? Modified version of that was distributed as for the longest time. Outputs all chars on 1 line. Program is 3 rows tall instead of 2. Unclear who made these modifications, or why. Chris Pressey 5/29/118 Modified version of that does not use stringmode and thus can be compiled by bef2c. CC0 Wim Rijnders 6/5/97 Program which reproduces itself in Befunge-space. CC0 Dmitry M Litvinov 12/1/96 A minimalist adventure game. n - go north. s - go south. e - go east. w - go west. d - dress. l - labour. CC0 Chris Pressey 9/5/93 "Like Eliza, except better :-)" CC0 Chris Pressey 9/5/93 Makes 'enigmatic aphorisms.' A loose interpretation of a program in '1001 things to do with your Commodore 64.' This is an example of how to simulate a 'gosub' with a value. CC0 Chris Pressey ?/?/?? Shortly after was written, a version using self-modifying code for the branches ( was written. Unfortunately it didn't work. This version of it works, but unfortunately doesn't quite do the same thing as Greg Wright 6/5/97 Euclidean algorithm. CC0 Chris Pressey 9/5/93 Asks for a number, and supplies the factorial of that number. Jason Reed 5/18/97 Factorial generator, (3x12) Chris Lahey 6/8/97 (23x1) factorial generator. CC0 Chris Pressey 9/5/93 The ubiquitous "Hello, World!" program. CC0 Chris Pressey 9/5/93 Translates ASCII input into hex output. CC0 Chris Pressey 9/5/93 Prints out "Hello, World!' forwards, then backwards, then forwards, etc. Demonstrates how one can so easily change the direction of the PC to support their own wicked desires. Jeremy S. Vine 5/29/113 A Befunge program posted to the #esoteric IRC channel on by Jeremy S. Vine, at the conclusion of an interview. Keymaker 9/3/108 The first of a series of really fine quines (self-printing programs) by Keymaker. Keymaker 9/3/108 The second of a series of really fine quines by Keymaker. Keymaker 9/3/108 The third of a series of really fine quines by Keymaker. CC0 Dmitry M Litvinov 6/1/97 An implementation of John Conway's game of Life. Greg Wright 6/5/97 3x3-Matrix Addition Chris Lahey 4/11/97 A Mandelbrot fractal generator. CC0 Chris Pressey 9/5/93 A conversion of a Commodore-64 graphical pastime: a dead-simple random maze generator. CC0 Dmitry M Litvinov 2/1/96 "First, example easy writed stupid prog." Befunge bypasses cultural and lingual backgrounds. Try this "easily written" program and see what it does. CC0 Chris Pressey 9/5/93 Produces single-digit numerological equivalents of words you type in. Words should consist of lowercase letters and be terminated by a linefeed character. (Users should be warned that the significance of the output of this program is of extremely questionable practical value. But it is consistant.) (This algorithm could be known as taking the "digital root of the word".) Aaron Dale 3/20/97 A program to implement the "pairing function" (\<x1,x2> = (2\^(x1) * (2*(x2) + 1)) - 1), which maps any two natural numbers onto the set of natural numbers, without repetition. CC0 Chris Pressey 8/25/112 Checks if the first line of input is a pangram -- a sentence which contains all the letters of the alphabet, such as "The quick brown fox jumps over the lazy dog" or "Pack my lunch box with five dozen liquor jugs." Case-insensitive, and ignores most punctuation, but "high" punctuation (above ASCII character 90) will likely confuse it. CC0 Chris Pressey 7/12/97 Generates a gasket (Sierpinsky triangle) using Pascal's Triangle. CC0 Ben Olmstead 6/25/97 Produces the first hundred digits of pi in under one hundred characters of Befunge, but cheats in that it simply decompresses the digits encoded in the source code. Kalyna Zazelenchuk 9/5/93 Lists the integers between 2 and 127 (inclusive), and reports whether each one is prime. Also reports that -128 is not prime. CC0 Chris Pressey 9/5/93 Generates random numbers between 1 and 9 as statistically evenly distributed as the computer's random number generator. Ken Bateman 4/12/97 A 3x10 random number generator. Ken Bateman 4/12/97 A 5x7 flexible random number generator. The number of bits is set with the 88+ at the top left. As shown this program will generate a random number from 0 to 32767. CC0 Ben Olmstead 4/24/97 A 2x13 random number generator that generates numbers from -128 to 127. (On an interpreter with unsigned char cells, such as the one on which this example was originally developed, it will produce values from 0..255.) CC0 Ben Olmstead 4/24/97 A 2x12, infinitely looping random number generator, which was originally intended to generate numbers in the range 0..31, but in actuality, it generates random powers of 2. Fixing it to generate 0..31 is left as an exercise for the reader. Greg Wright 5/18/97 4x7 random number generator. Artyom Baranov 4/5/96 THE smallest Befunge RNG-16. (16x1) Kalyna Zazelenchuk 9/5/93 This program, crammed into a 14x14 block, makes random numbers from 1 to 16 using multiple "?" statements. CC0 Chris Pressey 9/5/93 12x9 random number generator, like and Matthew D Moss 2/1/96 A 7x7 random number generator in the tradition of .., but using mathematics to reduce the problem before writing the code CC0 Dmitry M Litvinov 2/1/96 A 4x10 random number generator which produces the same output as .. Unlike most Befunge sources this one has a symmetrical beauty to it. CC0 Chris Pressey 3/10/96 An 8x4 random number generator a la Artyom Baranov 2/28/96 A 13x3 random number generator a la and Chris Howe 4/9/97 A 4x9 flexible random number generator; if you change the 4 in position (1,2) to another integer n it will generate a number between 1 and 2\^n (inclusive) for 0\<n\<9. Chris Lahey 4/11/97 A 3x7 random number generator. CC0 Chris Pressey 9/5/93 You control an 'O' going through a maze of '*''s. You can type in 'n', 's', 'e', or 'w', and the 'O' travels in that map direction. This not-particularly-challenging game ends when you hit a '*'. ??? 9/11/97 Performs the rot13 algorithm. CC0 Dmitry M Litvinov 2/22/96 A command-line calculator with postfix notation. Kimberley Burchett 11/16/96 A version of crammed into a 23x12 block. CC0 Chris Pressey 12/1/96 A self-reproducing 80x1 program. This program can also be used to test for the @ vs StringMode bug. Kevin Vigor 5/8/97 A 14-byte (almost-)self-reproducing program (the result contains an extra space, but is itself a 15-byte self-reproducing program.) David Johnston 5/7/97 Crammed (14x6) self-listing program. Denis Moskowitz 5/8/97 14-byte quine. This was submitted as a tiny fix to which makes it reproduce itself exactly. CC0 Dmitry M Litvinov 2/21/96 A self-reproducing Befunge program, 13x4. Kevin Vigor 4/9/97 Generates and prints a Sierpinsky triangle, a simple type of fractal. Since the resolution is 20x30, the detail of the fractal isn't really visible, but hey, what can you do? This is the second revision, released 4/10/97, which is Improved. CC0 Dmitry M Litvinov 12/1/96 Program to generate sine wave patterns. Based on cos(a+b)=cos(a)*cos(b)-sin(a)*sin(b) and sin(a+b)=sin(a)*cos(b)+cos(a)*sin(b). sin and cos values are kept in one stack cell = abs(sin) * 2\^16 + abs(cos). Kalyna Zazelenchuk 9/5/93 Same as, except sorts the letters of your word in ascending order. Timothy Howe 11/26/96 A big surprise. Zach Baker 7/10/97 A real purty 'switch' statement. NOTE: This is not a runnable problem in itself. It's just a (two-dimensional) snippet of code. CC0 Chris Pressey 10/27/111 Tests whether the # instruction interacts properly with wrapping. CC0 Chris Pressey 8/23/111 Tests how your implementation of Befunge-93 calculates modulus (there is no right way.) CC0 Chris Pressey 10/5/118 Prints out the largest and smallest values that can be stored in a playfield cell in your implementation of Befunge-93. A very large number of C compilers interpret char to mean a signed 8-bit value, so a very common result of running this is "127 -128". CC0 Chris Pressey 9/5/93 Converts letters to upper-case. An example of the ` (greater) statement. CC0 Wim Rijnders 8/15/97 The classic game of Hunt the Wumpus!