git @ Cat's Eye Technologies Befunge-93 / aeba09c
Merge pull request #17 from catseye/examples-fixes Examples fixes Chris Pressey authored 3 years ago GitHub committed 3 years ago
26 changed file(s) with 175 addition(s) and 395 deletion(s). Raw diff Collapse all Expand all
66 copyrighted by their original authors. See the file LICENSE for more
77 information.
88
9 -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
10 Name License Author Date Notes
11 ---------------------------- --------- --------------------- ---------- -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
12 [anagram.bf](anagram.bf) Kalyna Zazelenchuk 1/1/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 'rand2.bf' to generate random numbers.
9 **NOTE**: in the interests of improving the general experience of exploring
10 these examples, some buggy and/or bitrotting examples have been removed
11 in the 2.25 release. Refer to the 2.24 release if you wish to find them.
1312
14 [aturley.bf](aturley.bf) CC0 Andrew Turley 1/1/2999 aturley's .sig; cellular automata gasket generator.
13 **NOTE**: many of these programs were developed on interpreters that did not
14 produce warnings. When running them with `bef` it is recommended to
15 suppress extraneous output with `bef -q`.
1516
16 [beer.bf](beer.bf) 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. Part of the Beer Song archive.
17 **NOTE**: dates are given in Month/Day/Year Minus 1900 format, and many of
18 these dates are questionable, especially when Day is 1.
1719
18 [beer10.bf](beer10.bf) Chris Lahey 6/8/97 A squashed (22x10) beer singing program, gramatically correct.
19
20 [beer2.bf](beer2.bf) Keith Arner 4/10/97 Another "99 Bottles of Beer" program.
21
22 [beer3.bf](beer3.bf) Chris Lahey 4/11/97 Another singing algorithm.
23
24 [beer4.bf](beer4.bf) Denis Moskowitz 4/11/97 Yet another singing algorithm.
25
26 [beer5.bf](beer5.bf) David Johnston 4/11/97 Another singing program.
27
28 [beer6.bf](beer6.bf) Chris Lahey 4/11/97 A crammed (14x21) singing program.
29
30 [beer7.bf](beer7.bf) CC0 Wim Rijnders 5/2/97 A beer bottling program.
31
32 [beer8.bf](beer8.bf) CC0 Wim Rijnders 5/12/97 Again with the bottles.
33
34 [beer9.bf](beer9.bf) David Johnston 5/13/97 Crammed (22x9) singing beer program which doesn't use good grammar or punctuation.
35
36 [befbef.bf](befbef.bf) 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.
37
38 [befbef2.bf](befbef2.bf) CC0 Wim Rijnders ?/?/00 A version of befbef.bf with some bugs (pointed out by Amir Karger) fixed.
39
40 [befunge1.bf](befunge1.bf) Denis Moskowitz 7/17/97 Befunge logo source.
41
42 [befunge2.bf](befunge2.bf) Sam Holden 7/17/97 Befunge logo source.
43
44 [befunge3.bf](befunge3.bf) Ben Olmstead 7/18/97 Befunge logo source.
45
46 [befunge4.bf](befunge4.bf) Kevin Vigor 8/13/97 Befunge logo source.
47
48 [befungex.bf](befungex.bf) Kevin Vigor 7/18/97 Non-standard (oversize) Befunge logo source.
49
50 [calc.bf](calc.bf) 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.
51
52 [cascade.bf](cascade.bf) CC0 Chris Pressey 7/20/97 Like copyme.bf, but continues to replicate itself.
53
54 [chars.bf](chars.bf) Kalyna Zazelenchuk 1/1/93 Generates a printable ASCII table, with characters and corresponding codes in decimal, from 34 to 127.
55
56 [copyme.bf](copyme.bf) CC0 Wim Rijnders 6/5/97 Program which reproduces itself in Befunge-space.
57
58 [digitalr.bf](digitalr.bf) Keymaker 9/3/08 Computes the digital root (see numer.bf) of the input.
59
60 [dladv.bf](dladv.bf) CC0 Dmitry M Litvinov 12/1/96 A minimalist adventure game.\
61 n - go north\
62 s - go south\
63 e - go east\
64 w - go west\
65 d - dress\
66 l - labour
67
68 [drx.bf](drx.bf) CC0 Chris Pressey 1/1/93 "Like Eliza, except better :-)"
69
70 [ea.bf](ea.bf) CC0 Chris Pressey 1/1/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.
71
72 [easm.bf](easm.bf) CC0 Chris Pressey 1/1/93 Same as 'ea.bf', but uses self-modifying code.
73
74 [euclid.bf](euclid.bf) Greg Wright 6/5/97 Euclidean algorithm.
75
76 [fact.bf](fact.bf) CC0 Chris Pressey 1/1/93 Asks for a number, and supplies the factorial of that number.
77
78 [fact2.bf](fact2.bf) Jason Reed 5/18/97 Factorial generator, (3x12)
79
80 [fact3.bf](fact3.bf) Chris Lahey 6/8/97 (23x1) factorial generator.
81
82 [hello.bf](hello.bf) CC0 Chris Pressey 1/1/93 The ubiquitous "Hello, World!" program.
83
84 [hex.bf](hex.bf) CC0 Chris Pressey 1/1/93 Translates ASCII input into hex output.
85
86 [hwii.bf](hwii.bf) CC0 Chris Pressey 1/1/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.
87
88 [kmquine.bf](kmquine.bf) Keymaker 9/3/08 The first of a series of really fine quines (self-printing programs) by Keymaker.
89
90 [kmquine2.bf](kmquine2.bf) Keymaker 9/3/08 The second of a series of really fine quines by Keymaker.
91
92 [kmquine3.bf](kmquine3.bf) Keymaker 9/3/08 The third of a series of really fine quines by Keymaker.
93
94 [life.bf](life.bf) CC0 Dmitry M Litvinov 6/1/97 An implementation of John Conway's game of Life.
95
96 [madd.bf](madd.bf) Greg Wright 6/5/97 3x3-Matrix Addition
97
98 [mandel.bf](mandel.bf) Chris Lahey 4/11/97 A Mandelbrot fractal generator.
99
100 [maze.bf](maze.bf) CC0 Chris Pressey 1/1/93 A conversion of a Commodore-64 graphical pastime: a dead-simple random maze generator.
101
102 [namegame.bf](namegame.bf) 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.
103
104 [numer.bf](numer.bf) CC0 Chris Pressey 1/1/93 Produces single-digit numerological equivalents of words you type in. (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 is also known as the "digital root".)
105
106 [pairing.bf](pairing.bf) 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.
107
108 [pangram.bf](pangram.bf) CC0 Chris Pressey 8/25/12 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.
109
110 [pascserp.bf](pascserp.bf) CC0 Chris Pressey 7/12/97 Generates a gasket (Serpinsky triangle) using Pascal's Triangle.
111
112 [pi.bf](pi.bf) 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.
113
114 [pi2.bf](pi2.bf) Kevin Vigor 7/2/97 Generates the first hundred digits of Pi. It does this not by cheating, but actually calculating Pi; unfortunately it far exceeds 100 characters of Befunge code.
115
116 [prime.bf](prime.bf) Kalyna Zazelenchuk 1/1/93 Lists the counting numbers incrementally from one and checks if each is prime.
117
118 [rand.bf](rand.bf) Chris Pressey 1/1/93 Generates random numbers between 1 and 9 as statistically evenly distributed as the computer's random number generator.
119
120 [rand10.bf](rand10.bf) Ken Bateman 4/12/97 A 3x10 random number generator.
121
122 [rand11.bf](rand11.bf) 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.
123
124 [rand12.bf](rand12.bf) Ben Olmstead 4/24/97 A 2x13, 0..255 random number generator.
125
126 [rand13.bf](rand13.bf) Ben Olmstead 4/24/97 A 2x12, infinitely looping 0..31 random number generator.
127
128 [rand14.bf](rand14.bf) Greg Wright 5/18/97 4x7 random number generator.
129
130 [rand15.bf](rand15.bf) Artyom Baranov 4/5/96 THE smallest Befunge RNG-16. (16x1)
131
132 [rand2.bf](rand2.bf) Kalyna Zazelenchuk 1/1/93 This program, crammed into a 14x14 block, makes random numbers from 1 to 16 using multiple "?" statements.
133
134 [rand3.bf](rand3.bf) Chris Pressey 1/1/93 12x9 random number generator, like rand.bf and rand2.bf.
135
136 [rand4.bf](rand4.bf) Matthew D Moss 2/1/96 A 7x7 random number generator in the tradition of rand.bf .. rand3.bf, but using mathematics to reduce the problem before writing the code
137
138 [rand5.bf](rand5.bf) CC0 Dmitry M Litvinov 2/1/96 A 4x10 random number generator which produces the same output as rand.bf .. rand4.bf. Unlike most Befunge sources this one has a symmetrical beauty to it.
139
140 [rand6.bf](rand6.bf) Artyom Baranov? 12/1/96 An 8x4 random number generator a la rand5.bf.
141
142 [rand7.bf](rand7.bf) ??? 12/1/96 A 13x3 random number generator a la rand5.bf and rand6.bf.
143
144 [rand8.bf](rand8.bf) 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.
145
146 [rand9.bf](rand9.bf) Chris Lahey 4/11/97 A 3x7 random number generator.
147
148 [rdp.bf](rdp.bf) CC0 Dmitry M Litvinov 2/1/96 A command-line calculator with postfix notation.
149
150 [rdp2.bf](rdp2.bf) Kimberley Burchette 12/1/96 A version of rdp.bf crammed into a 23x12 block.
151
152 [robot.bf](robot.bf) CC0 Chris Pressey 1/1/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 '\*'.
153
154 [rot13.bf](rot13.bf) ??? 9/11/97 Performs the rot13 algorithm.
155
156 [selflis2.bf](selflis2.bf) CC0 Chris Pressey 12/1/96 A self-reproducing 80x1 program. This program can also be used to test for the @ vs StringMode bug.
157
158 [selflis3.bf](selflis3.bf) Kevin Vigor 5/28/97 A 14-byte Quine (self-reproducing program.)
159
160 [selflis5.bf](selflis5.bf) David Johnston 5/7/97 Crammed (14x6) self-listing program.
161
162 [selflis6.bf](selflis6.bf) Denis Moskowitz 5/8/97 14-byte quine.
163
164 [selflist.bf](selflist.bf) ??? 12/1/196 A self-reproducing Befunge program, 13x4.
165
166 [serp.bf](serp.bf) Kevin Vigor 4/9/97 Generates and prints a Serpinsky 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?
167
168 [serp2.bf](serp2.bf) Kevin Vigor 4/10/97 Improved Serpinsky Triangle generator.
169
170 [sinus.bf](sinus.bf) CC0 Dmitry M Litvinov 12/1/96 Program to generate sine wave patterns.\
171 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)
172
173 [sort.bf](sort.bf) Kalyna Zazelenchuk 1/1/93 Same as anagram.bf, except sorts the letters of your word in ascending order.
174
175 [surprise.bf](surprise.bf) ??? 6/1/97 A big surprise.
176
177 [switchbx.bf](switchbx.bf) Zach Baker 7/10/97 A real purty 'switch' statement.
178
179 [testbrdg.bf](testbrdg.bf) CC0 Chris Pressey 10/27/11 Tests whether the \# instruction interacts properly with wrapping.
180
181 [testmodu.bf](testmodu.bf) CC0 Chris Pressey 8/23/11 Tests how your implementation of Befunge-93 calculates modulus (there is no right way.)
182
183 [toupper.bf](toupper.bf) CC0 Chris Pressey 9/1/93 Converts letters to upper-case. An example of the \` (greater) statement.
184
185 [wumpus.bf](wumpus.bf) CC0 Wim Rijnders 8/15/97 The classic game of Hunt the Wumpus!
186 -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
187
188
20 | Name | License | Author | Date | Notes |
21 | -------------------------- | ------- | ------------------- | -------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
22 | [anagram.bf](anagram.bf) | | 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 'rand2.bf' to generate random numbers.
23 | [aturley.bf](aturley.bf) | CC0 | Andrew Turley | 10/30/97 | aturley's .sig; cellular automata gasket generator.
24 | [beer.bf](beer.bf) | | 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.
25 | [beer10.bf](beer10.bf) | | Chris Lahey | 6/8/97 | A squashed (22x10) beer singing program, gramatically correct.
26 | [beer2.bf](beer2.bf) | | Keith Arner | 4/10/97 | Another "99 Bottles of Beer" program.
27 | [beer3.bf](beer3.bf) | | Chris Lahey | 4/11/97 | Another singing algorithm.
28 | [beer4.bf](beer4.bf) | | Denis Moskowitz | 4/11/97 | Yet another singing algorithm.
29 | [beer5.bf](beer5.bf) | | David Johnston | 4/11/97 | Another singing program.
30 | [beer6.bf](beer6.bf) | | Chris Lahey | 4/11/97 | A crammed (14x21) singing program.
31 | [beer7.bf](beer7.bf) | CC0 | Wim Rijnders | 5/2/97 | A beer bottling program.
32 | [beer8.bf](beer8.bf) | CC0 | Wim Rijnders | 5/12/97 | Again with the bottles.
33 | [beer9.bf](beer9.bf) | | David Johnston | 5/13/97 | Crammed (22x9) singing beer program which doesn't use good grammar or punctuation.
34 | [befbef2.bf](befbef2.bf) | 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.
35 | [befunge1.bf](befunge1.bf) | | Denis Moskowitz | 7/17/97 | Befunge logo source (meaning, the program is roughly in the shape of the word "BEFUNGE".)
36 | [befunge2.bf](befunge2.bf) | | Sam Holden | 7/17/97 | Befunge logo source.
37 | [befunge3.bf](befunge3.bf) | CC0 | Ben Olmstead | 7/18/97 | Befunge logo source.
38 | [befunge4.bf](befunge4.bf) | | Kevin Vigor | 8/13/97 | Befunge logo source which prints out some Befunge code (try running it.)
39 | [befungex.bf](befungex.bf) | | Kevin Vigor | 7/18/97 | Non-standard (oversize) Befunge logo source which also prints out some Befunge code.
40 | [calc.bf](calc.bf) | | 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.
41 | [cascade.bf](cascade.bf) | CC0 | Chris Pressey | 7/20/97 | Like copyme.bf, but continues to replicate itself.
42 | [chars.bf](chars.bf) | | Kalyna Zazelenchuk | 9/5/93 | Generates a printable ASCII table, with characters and corresponding codes in decimal, from 34 to 127.
43 | [chars2.bf](chars2.bf) | | ??? | ?/?/9? | Modified version of chars.bf that was distributed as chars.bf 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.
44 | [chars3.bf](chars3.bf) | | Chris Pressey | 5/29/118 | Modified version of chars2.bf that does not use stringmode and thus can be compiled by bef2c.
45 | [copyme.bf](copyme.bf) | CC0 | Wim Rijnders | 6/5/97 | Program which reproduces itself in Befunge-space.
46 | [dladv.bf](dladv.bf) | 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.
47 | [drx.bf](drx.bf) | CC0 | Chris Pressey | 9/5/93 | "Like Eliza, except better :-)"
48 | [ea.bf](ea.bf) | 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.
49 | [easm2.bf](easm2.bf) | CC0 | Chris Pressey | ?/?/?? | Shortly after `ea.bf` was written, a version using self-modifying code for the branches (`easm.bf`) was written. Unfortunately it didn't work. This version of it works, but unfortunately doesn't quite do the same thing as `ea.bf`.
50 | [eterlan.bf](eterlan.bf) | CC0 | Chris Pressey | 11/29/118| Generates a 50,000-word avant garde novel called ETERLAN SEPTEBMER. This novel generator was written for NaNoGenMo 2018 to mark the 25th anniversary of Befunge (1993-2018). It may contain a quote from Mark Topham. The novel consists of many short paragraphs consisting of long words, most of which start with X or Y. You can think of it as a kind of fireworks.
51 | [euclid.bf](euclid.bf) | | Greg Wright | 6/5/97 | Euclidean algorithm. Expects two integers as input, and outputs the greatest common divisor of those numbers.
52 | [fact.bf](fact.bf) | CC0 | Chris Pressey | 9/5/93 | Asks for a number, and supplies the factorial of that number.
53 | [fact2.bf](fact2.bf) | | Jason Reed | 5/18/97 | Factorial generator, (3x12)
54 | [fact3.bf](fact3.bf) | | Chris Lahey | 6/8/97 | (23x1) factorial generator.
55 | [hello.bf](hello.bf) | CC0 | Chris Pressey | 9/5/93 | The ubiquitous "Hello, World!" program.
56 | [hex.bf](hex.bf) | CC0 | Chris Pressey | 9/5/93 | Translates ASCII input into hex output.
57 | [hwii.bf](hwii.bf) | 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.
58 | [jsvine.bf](jsvine.bf) | | Jeremy S. Vine | 5/29/113 | A Befunge program posted to the #esoteric IRC channel on freenode.net by Jeremy S. Vine, at the conclusion of an interview.
59 | [kmquine.bf](kmquine.bf) | | Keymaker | 9/3/108 | The first of a series of really fine quines (self-printing programs) by Keymaker.
60 | [kmquine2.bf](kmquine2.bf) | | Keymaker | 9/3/108 | The second of a series of really fine quines by Keymaker.
61 | [kmquine3.bf](kmquine3.bf) | | Keymaker | 9/3/108 | The third of a series of really fine quines by Keymaker.
62 | [life.bf](life.bf) | CC0 | Dmitry M Litvinov | 6/1/97 | An implementation of John Conway's game of Life.
63 | [madd.bf](madd.bf) | | Greg Wright | 6/5/97 | 3x3-Matrix Addition. Expects two 3x3 matrices as input (essentially 18 integers), and outputs the sum of those two matrices.
64 | [mandel.bf](mandel.bf) | | Chris Lahey | 4/11/97 | A Mandelbrot fractal generator.
65 | [maze.bf](maze.bf) | CC0 | Chris Pressey | 9/5/93 | A conversion of a Commodore-64 graphical pastime: a dead-simple random maze generator.
66 | [namegame.bf](namegame.bf) | 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.
67 | [numer.bf](numer.bf) | 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".)
68 | [pairing.bf](pairing.bf) | | 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.
69 | [pangram.bf](pangram.bf) | 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.
70 | [pascserp.bf](pascserp.bf) | CC0 | Chris Pressey | 7/12/97 | Generates a gasket (Sierpinsky triangle) using Pascal's Triangle.
71 | [pi.bf](pi.bf) | 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.
72 | [prime.bf](prime.bf) | | 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.
73 | [rand.bf](rand.bf) | CC0 | Chris Pressey | 9/5/93 | Generates random numbers between 1 and 9 as statistically evenly distributed as the computer's random number generator.
74 | [rand10.bf](rand10.bf) | | Ken Bateman | 4/12/97 | A 3x10 random number generator.
75 | [rand11.bf](rand11.bf) | | 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.
76 | [rand12.bf](rand12.bf) | 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.)
77 | [rand13.bf](rand13.bf) | 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.
78 | [rand14.bf](rand14.bf) | | Greg Wright | 5/18/97 | 4x7 random number generator.
79 | [rand15.bf](rand15.bf) | | Artyom Baranov | 4/5/96 | THE smallest Befunge RNG-16. (16x1)
80 | [rand2.bf](rand2.bf) | | Kalyna Zazelenchuk | 9/5/93 | This program, crammed into a 14x14 block, makes random numbers from 1 to 16 using multiple "?" statements.
81 | [rand3.bf](rand3.bf) | CC0 | Chris Pressey | 9/5/93 | 12x9 random number generator, like rand.bf and rand2.bf.
82 | [rand4.bf](rand4.bf) | | Matthew D Moss | 2/1/96 | A 7x7 random number generator in the tradition of rand.bf .. rand3.bf, but using mathematics to reduce the problem before writing the code
83 | [rand5.bf](rand5.bf) | CC0 | Dmitry M Litvinov | 2/1/96 | A 4x10 random number generator which produces the same output as rand.bf .. rand4.bf. Unlike most Befunge sources this one has a symmetrical beauty to it.
84 | [rand6.bf](rand6.bf) | CC0 | Chris Pressey | 3/10/96 | An 8x4 random number generator a la rand5.bf.
85 | [rand7.bf](rand7.bf) | | Artyom Baranov | 2/28/96 | A 13x3 random number generator a la rand5.bf and rand6.bf.
86 | [rand8.bf](rand8.bf) | | 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.
87 | [rand9.bf](rand9.bf) | | Chris Lahey | 4/11/97 | A 3x7 random number generator.
88 | [robot.bf](robot.bf) | 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 '\*'.
89 | [rot13.bf](rot13.bf) | | ??? | 9/11/97 | Performs the rot13 algorithm.
90 | [rpn.bf](rpn.bf) | CC0 | Dmitry M Litvinov | 2/22/96 | A command-line calculator with postfix notation. Enter an expression like `10 3 + 567 89 * -` and press Enter to evaluate it (to obtain, in this case, `-50450`).
91 | [rpn2.bf](rpn2.bf) | | Kimberley Burchett | 11/16/96 | A version of `rpn.bf` crammed into a 23x12 block.
92 | [selflis2.bf](selflis2.bf) | CC0 | Chris Pressey | 12/1/96 | A self-reproducing 80x1 program. This program can also be used to test for the @ vs StringMode bug.
93 | [selflis3.bf](selflis3.bf) | | 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.)
94 | [selflis5.bf](selflis5.bf) | | David Johnston | 5/7/97 | Crammed (14x6) self-listing program.
95 | [selflis6.bf](selflis6.bf) | | Denis Moskowitz | 5/8/97 | 14-byte quine. This was submitted as a tiny fix to `selflis3.bf` which makes it reproduce itself exactly.
96 | [selflist.bf](selflist.bf) | CC0 | Dmitry M Litvinov | 2/21/96 | A self-reproducing Befunge program, 13x4.
97 | [serp2.bf](serp2.bf) | | 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.
98 | [sinus.bf](sinus.bf) | 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).
99 | [sort.bf](sort.bf) | | Kalyna Zazelenchuk | 9/5/93 | Same as anagram.bf, except sorts the letters of your word in ascending order.
100 | [surprise.bf](surprise.bf) | | Timothy Howe | 11/26/96 | A big surprise.
101 | [switchbx.bf](switchbx.bf) | | 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.
102 | [testbrdg.bf](testbrdg.bf) | CC0 | Chris Pressey | 10/27/111| Tests whether the \# instruction interacts properly with wrapping.
103 | [testmodu.bf](testmodu.bf) | CC0 | Chris Pressey | 8/23/111 | Tests how your implementation of Befunge-93 calculates modulus (there is no right way.)
104 | [testpfcl.bf](testpfcl.bf) | 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".
105 | [toupper.bf](toupper.bf) | CC0 | Chris Pressey | 9/5/93 | Converts letters to upper-case. An example of the \` (greater) statement.
106 | [wumpus.bf](wumpus.bf) | CC0 | Wim Rijnders | 8/15/97 | The classic game of Hunt the Wumpus!
+0
-24
eg/befbef.bf less more
0 028p038p108p018pv
1 vp91+56p900< v_v#!-+1"!":< >:"<"-!#v_:"^"-!#v_ v
2 >"*"09g:19g\19gg29p p 29g28g #^_ :" "-!#v_:"v"-#^_ v
3 ^p91+g91g81p90+g90g 8 0pg91g90g92$ < <
4 >: >38g7p38g1+38p^p811p800<
5 >28g!28p ^p810p80-10< <
6 ^p81-10p800 <
7 ^p810p801< _v#!-">":<
8 ^ -"0":_v#`\+1"9":_v#` -1"0":< #
9 > # >:"!"1+-!#v_v
10 #######################>19g+\48gp ^ p #82!g82<
11 0"!dlroW olleH">v # ^ g7-1g83_v#!-":":<
12 ,: # >$, ^ < #>:"p"-!#v_v
13 ^_25*,@# v_^#-4:_v#-3:_v#-1:_v#-2:\g7p83:-1_v#:g83<2<
14 ####################### >:5-#v_v$ ^ # 0 #<
15 ^ _v#-6< > $6 v >$09g+48p1 >> ^
16 >$0> # ^ <
17 v_ ^
18
19 >* ^ ^3_v#!-"_": <
20 >:","-#v_4 ^
21 ^5_v#!-"*":<
22
23 > #@ ^
+0
-21
eg/bridgeit.bf less more
0 v> v
1 "Enter position of your move or 0 to quit: "<v
2 >1095+p vv*25 <
3 " c c c c c " <v*25
4 "h 1 h 2 h 3 h 4 h 5 h" <v*25
5 " c 6 c 7 c 8 c 9 c " <v*25
6 "h 10 h 11 h 12 h 13 h 14 h" <v*25
7 " c 15 c 16 c 17 c 18 c " <v*25
8 "h 19 h 20 h 21 h 22 h 23 h" <v*25
9 " c 24 c 25 c 26 c 27 c " <v*25
10 "h 28 h 29 h 30 h 31 h 32 h" <v*25
11 " c 33 c 34 c 35 c 36 c " <v*25
12 "h 37 h 38 h 39 h 40 h 41 h" <v*25
13 " c c c c c "># #< #v*25 $# $# $# v#
14 AFGHIBCDEKJPQRSLMNOUTZ[\]VWXY`_defg^abcih>:#,_&:!#v_95+g"@"-095+pv
15 39=BG5:?E39=BG5:?E39=BG5:?E39=BG5:?E39=BG
16 33333444455555666677777888899999::::;;;;;
17 v"My move is " <
18 >:#,_095+g:.v v"I accept your wish to concede."*25<
19 v,*25,"." < >:#,_@
20 v>:"|"\:96+\g\97+\g1+p
0 25*3*4+>:."=",:," "v
1 |-*2*88:+1,,, <
2 @
0 25*3*4+>:."=",:,25*,1+:88*2*-#v_@
1 ^ <
0 25*3*4+>:."=",:," "v
1 |-*2*88:+1,,, <
2 @
0 84*2+>:.88*3-,:,55+,v
1 |- -1*2*88 :+1<
2 @
+0
-2
eg/digitalr.bf less more
0 > > ~ :#v_$68*+v
1 ^%9_^#`9:+-*86<@,*52,<
+0
-12
eg/easm.bf less more
0 >800p 11v
1 v"love"0 < >+v
2 v"power"0 < 1$:
3 v"strength"0?^# <0
4 v"success"0 ?v g 0
5 v"agony"0 < 0 p
6 v"beauty"0 < 0 9
7 v ,<p 2
8 >" eht si ">: |g +
9 >" fo "> v <0 -
10 >25*"."^ >" "10^^_v
11 ^ <
0 5 52** 52** 52** 52** 1- 0v0 <
1 >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>v>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>v -
2 ^ v 1
3 ^ " " " " " " " " " " " " " " " " " v |
4 ^ X Y X Y X Y X Y I X Y X Y X Y X Y v @
5 ^ " " " " " " " " "# " " " " " " " " v #
6 ^ "N"?"S"?"E"?"W"?"U"?"D"?"L"?"R"?"P"?"G"?"C"?"C"?"F"?"O"?"U"?"R"?"A"?"M" v :
7 ^ " " " " " " " " " " " " " " " " " v $
8 ^ J U B I L A N T B E F U N G I N G v >^
9 ^ " " " " " " " " "# " " " " " " " " v ,,
10 ^ "H"?"E"?"Y"?"M"?"Y"?"A"?"R"?"C"?"H"?"I"?"V"?"E"?"M"?"U"?"S"?"T"?"B"?"E" v ,*
11 ^ " " " " " " " " v " " " " " " " " v :4
12 ^ W I N N I P E G >v< M A N I T O B A v *8
13 ^ " " " " " " " " v " " " " " " " " v 2
14 ^ "C"?"O"?"R"?"R"?"U"?"P"?"T"?"X"?"T"?"H"?"E"?"S"?"E"?"F"?"I"?"L"?"E"?"S" v 5
15 ^ " " " " " " " " " " " " " " " " " v
16 ^ S E P T E M B E R M C M X C I I I v>?^
17 ^ " " " " " " " " " " " " " " " " " v ^
18 ^ "A"?"L"?"L"?"L"?"O"?"O"?"K"?"L"?"I"?"K"?"E"?"G"?"A"?"R"?"B"?"A"?"G"?"E" v v<
19 ^ " " " " " " " " " " " " " " " " " v #|
20 ^ X Y X Y X Y X Y O X Y X Y X Y X Y v ^<
21 ^ " " " " " " " " " " " " " " " " " v ,#
22 ^ v :
23 ^<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>^
0 >v > v
1 v<>^ v,,,"Tha"<
2 >>^ "
3 v,,,,,!HEX
4 sHAM
5 kHEX
6 nHAM
7 "HEX
8 >,,,"!",@
0 000p>~:25*-!#v_"a"-1+00g+00p>00g9`#v_v
1 @.g00< vp00+%*52g00/*52g00<
2 ^ ># ^# <
0 000p>~:25*-!#v_"a"-1+00g+00p> 00g9`#v_v
1 @.g00< vp00+%*52g00 /*52g00<
2 ^ ># ^# <
+0
-23
eg/pi2.bf less more
0 aa* v +------------------------+
1 vp*9920p*9930< | Pi generator in Bef-97 |
2 >:09a*pa*3/1+19a*p09a*g:09b*v | |
3 v_@# g*b90 p*b910 < p< | 7/2/1997, Kevin Vigor |
4 >19a*g:+1-29b*p19a*g::09v +------------------------+
5 v*a90g*b90*g*b91: _v#p*9<
6 >g-#v_ 2a*+\$ v :$
7 >\1-aa*ga*+v p
8 v1:/g*b92p*991:< *
9 >9b*p29b*g*199*g\v9
10 v*b92p*aa-1g*990-<9
11 >g2-29b*p099*g1-:0^
12 v -9p*b92:%ag*991 <
13 >#v_ 299*g1+299*p> ^
14 >09b*g:#v_$v
15 v93p*b90-1<
16 >9*g199*ga/+.v
17 v:g*992 <p*9 92-<
18 v_29b*g399*p ^
19 >09b*g:#v_v 1
20 vp*b90-1 < $ g
21 >199*g9`#v_'9,v *
22 >'0, >' ,299^
+0
-25
eg/postfix.bf less more
0 =l b93
1 =# postfix.bf
2 =# Dmitry M Litvinov
3 =# 2/1/96
4 =# A command-line calculator with postfix notation.
5 > v ****** Postfix-Calculator ******
6 >v"Enter forth-expressions:"*250< * 10 3+567 89*- <Enter> -50450 *
7 ,: ********************************
8 ^_$ v
9 > v
10 ^+*+91\-"0"<
11 |`!"9":< ~
12 |!`\"0":<
13 v < < \
14 0
15 >:"9"`!|
16 >:"0"\`!|
17 >:25*-| > v
18 >:"/"-| $ $
19 >:"*"-| $ . v"error"*25<
20 >:"-"-| $ / 2 >25*,,,,,,,v
21 >:"+"-| $ * 5
22 >~>:" "-| $ - *
23 $ + ,
24 ^ < < < < < < <
+0
-17
eg/postfix2.bf less more
0 =l b93
1 =# postfix2.bf
2 =# Kimberley Burchette
3 =# 12/1/96
4 =# A version of postfix.bf crammed into a 23x12 block.
5 100p010p v p00+g00 <
6 >~:25*-!#v_v
7 vp3+1g00"@"p3g00"."< #
8 >
9 v <#
10 >:"/"`!#v_ :":"\`#v_v
11 v p010< <
12 > 00g3p 1 ^
13 v_^# p011 g01 <
14 > 00g:::"2"\3p"5"\1+ v
15 v p3+3\"*"p3+2\"*"p3 <
16 > 00g4+3p"+"00g5+3p 6 ^
0 222p35*89+*11p>133p >33g1+33p 22g33g- v>22g33g%#v_v
0 222p882**1+11p>133p >33g1+33p 22g33g- v>22g33g%#v_v
11 o >|
22 2 v,,,,, ,,,,,.g22"is prime."<
33 1 > v^ <
+0
-6
eg/quine.bf less more
0 =l b93
1 =# quine.bf
2 =# Denis Moskowitz
3 =# 5/8/97
4 =# 14-byte quine.
5 :0g,:93+`#@_1+
+0
-11
eg/quine2.bf less more
0 =l b93
1 =# quine2.bf
2 =# David Johnston
3 =# 5/7/97
4 =# Crammed (14x6) self-listing program.
5 g,10g,200p1 v<
6 vg,gg01g <p0<0
7 >1+:95*-#^ #<|
8 v+1g01p,*25$ <
9 >:6-#v_@>10p^
10 > ^
+0
-9
eg/quine3.bf less more
0 =l b93
1 =# quine3.bf
2 =# Andrew Turley
3 =# 12/1/96
4 =# A self-reproducing Befunge program, 13x4.
5 v>>0>:04gg,1v
6 0p | -*27:+<
7 04|<>04g1+:0v
8 >^@^-4,*25p4<
+0
-20
eg/rdp.bf less more
0 > v ****** Postfix-Calculator ******
1 >v"Enter forth-expressions:"*250< * 10 3+567 89*- <Enter> -50450 *
2 ,: ********************************
3 ^_$ v
4 > v
5 ^+*+91\-"0"<
6 |`!"9":< ~
7 |!`\"0":<
8 v < < \
9 0
10 >:"9"`!|
11 >:"0"\`!|
12 >:25*-| > v
13 >:"/"-| $ $
14 >:"*"-| $ . v"error"*25<
15 >:"-"-| $ / 2 >25*,,,,,,,v
16 >:"+"-| $ * 5
17 >~>:" "-| $ - *
18 $ + ,
19 ^ < < < < < < <
+0
-12
eg/rdp2.bf less more
0 100p010p v p00+g00 <
1 >~:25*-!#v_v
2 vp3+1g00"@"p3g00"."< #
3 >
4 v <#
5 >:"/"`!#v_ :":"\`#v_v
6 v p010< <
7 > 00g3p 1 ^
8 v_^# p011 g01 <
9 > 00g:::"2"\3p"5"\1+ v
10 v p3+3\"*"p3+2\"*"p3 <
11 > 00g4+3p"+"00g5+3p 6 ^
+0
-7
eg/revquine.bf less more
0 =l b93
1 =# revquine.bf
2 =# Chris Pressey
3 =# 12/1/96
4 =# A self-repoducing 80x1 program. This program can also be used to test
5 =# for the @ vs StringMode bug.
6 ">:#,_66*2-,@This prints itself out backwards...... but it has to be 80x1 cells
0 > v ****** Postfix-Calculator ******
1 >v"Enter forth-expressions:"*250< * 10 3+567 89*- <Enter> -50450 *
2 ,: ********************************
3 ^_$ v
4 > v
5 ^+*+91\-"0"<
6 |`!"9":< ~
7 |!`\"0":<
8 v < < \
9 0
10 >:"9"`!|
11 >:"0"\`!|
12 >:25*-| > v
13 >:"/"-| $ $
14 >:"*"-| $ . v"error"*25<
15 >:"-"-| $ / 2 >25*,,,,,,,v
16 >:"+"-| $ * 5
17 >~>:" "-| $ - *
18 $ + ,
19 ^ < < < < < < <
0 100p010p v p00+g00 <
1 >~:25*-!#v_v
2 vp3+1g00"@"p3g00"."< #
3 >
4 v <#
5 >:"/"`!#v_ :":"\`#v_v
6 v p010< <
7 > 00g3p 1 ^
8 v_^# p011 g01 <
9 > 00g:::"2"\3p"5"\1+ v
10 v p3+3\"*"p3+2\"*"p3 <
11 > 00g4+3p"+"00g5+3p 6 ^
0 :0g,:93+`#@_1+
0 :0g,:94+`#@_1+
+0
-21
eg/serp.bf less more
0 54*54**52**912p913pv < v " "0
1 >1-:v v " "0
2 v g21g31_$ v v " "0
3 v < v " "0
4 0v v 5 v " "0
5 >?>?>v > ^ 2 v " "0
6 1+2+ , * v " "0
7 >^>^:$ " , v " "0
8 v:-1_^ . v " "0
9 v-1_$53*0v " v " "0
10 v_054* v ^_^ v " "0
11 >56*54* v % v " "0
12 >02p03pv * v " "0
13 v/2+g20< 2 v " "0
14 >\03g+2/\v 5 v " "0
15 v"*"p31p21< : v " "0
16 >13g76*+12gp ^ 0 v " "0
17 vp\-4*99\"<":< v " "0
18 >:v: >#< 1+:54*\` | v " "0
19 ^,_$25*,^ @ v " "0
20 ^ ># #< ^
0 000p>00g1+01p01g00g`#v_00g.000p>00g1-01p00g01g`#v_00g.@
1 ^p00+1g00 < ^p00-1g00 <