git @ Cat's Eye Technologies Befunge-93 / rel_2_21_2004_0920
Add befunge93-2004.0920 docs and example sources. catseye 12 years ago
90 changed file(s) with 1504 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
0 <html><head><title>Befunge-93 Documentation</title></head>
1 <body>
2 <center><H1>Befunge-93 Documentation</H1>
3 <hr><font size=+1>
4 <i>Twisted, Deranged Programming Language in the
5 Tradition of </i><a href="http://www.muppetlabs.com/~breadbox/bf/">Brainf*ck</a>
6 <i>and</i> <a href="http://wouter.fov120.com/false/">False</a></font><p>
7 Chris Pressey, Cat's Eye Technologies<br>
8 <i>Original document September, 1993</i><br>
9 <i>Updated December, 1996</i><br>
10 <i>Updated Yet Again September, 2004</i><br>
11 </center>
12 <h3>The Basics of Befunge-93</h3>
13
14 <p>Most likely the most unique element of Befunge-93 programming is the
15 Program Counter (PC.) In almost all computer programming languages,
16 the program counter is continually moving forward through the program,
17 occassionally jumping to another spot in the code (but continuing
18 forward thereafter, nonetheless.)</p>
19
20 <p>The PC in Befunge-93, however, is subject to different rules. It
21 may go <i>forward, backward, left, or right</i>. A Befunge-93 program
22 is treated as an 80x25 torus (a page which wraps around on the edges)
23 of ASCII text. Certain commands change the direction of the progress
24 of the PC. By default, the PC points to the upper-left
25 corner of the program, and is oriented to travel left-to-right.</p>
26
27 <p>Each command in Befunge-93 is a single character, as is the largest
28 data unit that can be specified in the program source; Befunge-93 programs
29 have a maximum size of 80x25 total commands and data bytes. There are
30 no run-time variables, only a single run-time stack. Befunge-93 programs
31 allow for self-modification. Due to the 2-dimensional nature of the PC,
32 they also allow for some extremely quirky code.</p>
33
34 <h3>The Stack</h3>
35
36 <p>Something like Forth and PostScript, Befunge-93 supports a LIFO,
37 Reverse Polish Notation (RPN or <i>postfix</i>) stack of signed long
38 integers (that is, each cell of the stack can hold as much as a C language
39 <code>signed long int</code> on the same platform.) The act of
40 placing a value on the stack is called
41 <i>pushing</i>, and the act of taking a value off the stack is
42 called <i>popping</i>. The digits from <code>0</code> to <code>9</code> are valid
43 Befunge-93 commands which push their respective values
44 onto the stack. A double quote <code>"</code>, when encountered, toggles
45 <i>stringmode</i>, and while stringmode is active, all character
46 cells will have their ASCII value
47 pushed onto the stack until another <code>"</code> is located.</p>
48
49 <p>There are a few basic calculation commands:
50 <ul>
51 <li><code>+</code> addition</li>
52 <li><code>-</code> subtraction</li>
53 <li><code>/</code> integer division
54 <li><code>*</code> multiplication
55 <li><code>%</code> modulo
56 <li><code>!</code> logical negation
57 </ul>
58 These are explained in greater detail in the Commands section.</p>
59
60 <p>In order to push a number greater than 9 on the stack, calculations
61 must be done with numbers less than or equal to 9. In any other
62 language
63 this would be a pain. In Befunge-93 it is a joy. For example, to
64 push '123' onto the stack, one might push 9, then 9, then multiply
65 (leaving 81), then push 7, then 6, then multiply (leaving 81 and
66 42,) then add (leaving 123.) In Befunge, this would look something
67 like :
68 <ul>
69 <code>99*76*+</code>
70 </ul>
71 This is, of course, assuming that the PC starts at or
72 before the first <code>9</code> and is working towards the right.
73 If this snippet represents a entire Befunge-93 program, this
74 assumption is correct: the PC starts at the upper-left of the
75 torus and is initially oriented to execute rightward.</p>
76
77 <p>NB. If the stack is be empty when you pop something off,
78 be warned that this will <i>not</i> generate an underflow! It will
79 simply push a 0 value onto the stack. Hope you can live with it!</p>
80
81 <h3>The Program Counter in Detail</h3>
82
83 <p>There are 5 commands which unconditionally control the PC direction:
84 <code>&gt;</code>, <code>&lt;</code>, <code>v</code>, <code>^</code>,
85 and <code>?</code>. <code>&gt;</code> makes the PC travel to the right;
86 <code>&lt;</code> to the left; <code>v</code> down; <code>^</code> up;
87 and <code>?</code> in a <i>random</i> direction. So, the following
88 example is an infinite loop:
89 <ul>
90 <code>&gt;&lt;</code>
91 </ul>
92 As is:
93 <ul>
94 <code>&gt;v<br>^&lt;</code>
95 </ul>
96 As is:
97 <ul>
98 <code>&gt;v&gt;v<br>&nbsp;&gt;^<br>^&nbsp;&nbsp;&lt;</code>
99 </ul>
100 Note that <code>&nbsp;</code> (space) is a null command which does nothing.</p>
101
102 <p>Should the PC encounter the 'edge' of the program, such as if
103 you were to try to execute:
104 <ul>
105 <code>&lt;</code>
106 </ul>
107 The PC will 'wrap around' to the other 'edge' of the program. This example,
108 then, is an infinite loop as well.</p>
109
110 <h3>Decision Making</h3>
111
112 <p>The standard 'if' statement in Befunge-93 is either
113 <code>_</code> or <code>|</code>, depending
114 on how you want to branch. Both of these instructions
115 pop a value off the stack and check to
116 see if it is true (non-zero,) and change the direction of the PC
117 accordingly:
118
119 <ul>
120 <li><code>_</code> acts like <code>&lt;</code> if the value is true or <code>&gt;</code> if it is false; and</li>
121 <li><code>|</code> acts like <code>^</code> if the value is true or <code>v</code> if it is false.</li>
122 </ul>
123 </p>
124
125 <p>'While' loops can be made by sticking an 'if' in an infinite loop.
126 For example,
127 <ul>
128 <code>&gt;_@</code>
129 </ul>
130 (This program fragment pops all of the non-zero values off the
131 stack, and the first zero value, then exits [<code>@</code> is the exit command.])</p>
132
133 <h3>Input</h3>
134
135 <p>The <code>&amp;</code> (ampersand) command will get a numeric value (in decimal)
136 from the standard input and
137 push it on the stack. <code>~</code> (tilde) will get the next ASCII character from
138 standard
139 input and push it on the stack.</p>
140
141 <p>For example,
142 <ul>
143 <code>&,</code>
144 </ul>
145 ...prints out "A" if the user types "65 ", and...
146 <ul>
147 <code>~.</code>
148 </ul>
149 ...prints out "65 " if the user types "A".</p>
150
151 <h3>Output</h3>
152
153 <p>The <code>.</code> command will pop a value off the stack and output it as
154 a decimal integer, followed by a space, somewhat like Forth. <code>,</code> will
155 pop a value, interpret it as the ASCII value of a character, and output that character
156 (not followed by a space.)</p>
157
158 <p>For example,
159
160 <ul>
161 <code>665+*1-,</code>
162 </ul>
163 ...prints out ASCII 65 ("A".), and...
164 <ul>
165 <code>665+*1-.</code>
166 </ul>
167 ...prints out "65 ".</p>
168
169 <h3>Special Commands</h3>
170
171 <p><code>#</code> is the 'bridge' command... it causes the next command which would
172 normally be executed to be skipped over, and not executed. For
173 example,
174
175 <ul>
176 <code>&gt;123...@</code>
177 </ul>
178
179 would output "3 2 1 ", but
180
181 <ul>
182 <code>&gt;123#...@</code>
183 </ul>
184
185 would output "3 2 " with one of the '.''s being skipped. Judicious
186 use of <code>#</code> can make for very interesting code!</p>
187
188 <p><code>:</code> is the duplication command. It makes a copy of the top element
189 of the stack. This is useful, as demonstrated in the following program:
190
191 <ul>
192 <code>v.&lt;&gt;:| @</code>
193 </ul>
194
195 This program makes duplicates of each value on the stacked, which is checked,
196 and if non-zero, printed.</p>
197
198 <p><code>$</code> pops a value off the stack, but does nothing with it. So,
199
200 <ul>
201 <code>123.$.@</code>
202 </ul>
203
204 results in "3 1 ".</p>
205
206 <p><code>\</code> swaps the top two elements of the stack. So,
207
208 <ul>
209 <code>123\...@</code>
210 </ul>
211
212 results in "2 3 1 ".</p>
213
214 <p><code>`</code> (back-quote) is the 'greater-than' command. It compares the top two
215 values on the stack, and returns '1' if the first is greater than the
216 second. For example,
217
218 <ul>
219 <code>65`.</code>
220 </ul>
221
222 ...outputs "1 " and...
223
224 <ul>
225 <code>25`.</code>
226 </ul>
227
228 ...outputs "0 ".</p>
229
230 <h3>Self-Modification</h3>
231
232 <p>The last two commands that need to be explained are the ones that allow you to
233 examine and change the contents of the torus where the program is stored. This
234 'playfield' can be used for auxilliary storage when the stack alone will not suffice,
235 but keep in mind that it also contains the running program.</p>
236
237 <p>The <code>g</code> command examines the contents of the playfield.
238 It pops a <i>y</i> coordinate off the stack, then an <i>x</i> coordinate. It pushes the
239 value found at (<i>x</i>, <i>y</i>) onto the stack. If the thing at (<i>x</i>, <i>y</i>)
240 is a Befunge-93 instruction, the value pushed will be the ASCII value of that
241 character. From the point of view of the program text, <i>x</i> determines
242 the column and <i>y</i> determines the row; (0, 0) refers to the first (leftmost)
243 column and the first (topmost) row of the program source.</p>
244
245 <p>The <code>p</code> command alters the contents of the playfield.
246 It pops a <i>y</i> coordinate off the stack, then an <i>x</i> coordinate, and then
247 a value. It places the value into the torus at (<i>x</i>, <i>y</i>). If the program,
248 at some later point, executes the instruction at (<i>x</i>, <i>y</i>), it will be the
249 interpreted as the Befunge instruction in the ASCII character set with the same
250 value as was put there with the <code>p</code> instruction.</p>
251
252 <h3>Appendix A. Command Summary</h3>
253
254 <pre>COMMAND INITIAL STACK (bot->top)RESULT (STACK)
255 ------- ------------- -----------------
256 + (add) &lt;value1&gt; &lt;value2&gt; &lt;value1 + value2&gt;
257 - (subtract) &lt;value1&gt; &lt;value2&gt; &lt;value1 - value2&gt;
258 * (multiply) &lt;value1&gt; &lt;value2&gt; &lt;value1 * value2&gt;
259 / (divide) &lt;value1&gt; &lt;value2&gt; &lt;value1 / value2&gt; (nb. integer)
260 % (modulo) &lt;value1&gt; &lt;value2&gt; &lt;value1 mod value2&gt;
261 ! (not) &lt;value&gt; &lt;0 if value non-zero, 1 otherwise&gt;
262 ` (greater) &lt;value1&gt; &lt;value2&gt; &lt;1 if value1 &gt; value2, 0 otherwise&gt;
263 &gt; (right) PC -&gt; right
264 &lt; (left) PC -&gt; left
265 ^ (up) PC -&gt; up
266 v (down) PC -&gt; down
267 ? (random) PC -&gt; right? left? up? down? ???
268 _ (horizontal if) &lt;boolean value&gt; PC-&gt;left if &lt;value&gt;, else PC-&gt;right
269 | (vertical if) &lt;boolean value&gt; PC-&gt;up if &lt;value&gt;, else PC-&gt;down
270 " (stringmode) Toggles 'stringmode'
271 : (dup) &lt;value&gt; &lt;value&gt; &lt;value&gt;
272 \ (swap) &lt;value1&gt; &lt;value2&gt; &lt;value2&gt; &lt;value1&gt;
273 $ (pop) &lt;value&gt; pops &lt;value&gt; but does nothing
274 . (pop) &lt;value&gt; outputs &lt;value&gt; as integer
275 , (pop) &lt;value&gt; outputs &lt;value&gt; as ASCII
276 # (bridge) 'jumps' PC one farther; skips
277 over next command
278 g (get) &lt;x&gt; &lt;y&gt; &lt;value at (x,y)&gt;
279 p (put) &lt;value&gt; &lt;x&gt; &lt;y&gt; puts &lt;value&gt; at (x,y)
280 & (input value) &lt;value user entered&gt;
281 ~ (input character) &lt;character user entered&gt;
282 @ (end) ends program</pre>
283
284 <h3>The People Who Helped Make the Dream Reality</h3>
285
286 <p>Special thanks to Curtis Coleman, Jason Goga, Kalyna Zazelenchuk, Shawn Vincent,
287 Mike Veroukis, Urban Mueller, and Wouter van Oortmerssen.</p>
288
289 </body>
290 </html>
0 <HTML>
1 <HEAD>
2 <TITLE>Cat's Eye Technologies: Befunge Source Code (*.bf)</TITLE>
3 <META HTTP-EQUIV="Content-Type" CONTENT="text/html;CHARSET=iso-8859-1">
4 <META NAME="Author" Content="Chris Pressey">
5 <META NAME="Keywords" Content=" Cat's Eye Technologies Example Befunge Source Code Software Programs">
6 </HEAD>
7 <BODY bgcolor="#FFFFFF" text="#000000" link="#0000FF" vlink = "#007F00">
8 <CENTER><H1>Befunge-93 Example Programs</H1>
9
10 <TABLE BORDER=0 WIDTH=100%><TR>
11 <TD ALIGN=CENTER><B>Name</B><BR></TD>
12 <TD ALIGN=CENTER><B>Author</B><BR></TD>
13 <TD ALIGN=CENTER><B>Date</B><BR></TD>
14 <TD ALIGN=CENTER><B>Notes</B><BR></TD>
15 </TR>
16 <P><TR> <TD><A HREF="anagram.bf">anagram.bf</A><BR></TD>
17 <TD>Kalyna Zazelenchuk<BR></TD>
18 <TD>1/1/93<BR></TD>
19 <TD>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.<BR></TD>
20 </TR>
21 <TR> <TD><A HREF="aturley.bf">aturley.bf</A><BR></TD>
22 <TD>Andrew Turley<BR></TD>
23 <TD>1/1/2999<BR></TD>
24 <TD>aturley's .sig; cellular automata gasket generator.<BR></TD>
25 </TR>
26 <TR> <TD><A HREF="beer.bf">beer.bf</A><BR></TD>
27 <TD>Kevin Vigor<BR></TD>
28 <TD>4/9/97<BR></TD>
29 <TD>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.<BR></TD>
30 </TR>
31 <TR> <TD><A HREF="beer10.bf">beer10.bf</A><BR></TD>
32 <TD>Chris Lahey<BR></TD>
33 <TD>6/8/97<BR></TD>
34 <TD>A squashed (22x10) beer singing program, gramatically correct.<BR></TD>
35 </TR>
36 <TR> <TD><A HREF="beer2.bf">beer2.bf</A><BR></TD>
37 <TD>Keith Arner<BR></TD>
38 <TD>4/10/97<BR></TD>
39 <TD>Another "99 Bottles of Beer" program.<BR></TD>
40 </TR>
41 <TR> <TD><A HREF="beer3.bf">beer3.bf</A><BR></TD>
42 <TD>Chris Lahey<BR></TD>
43 <TD>4/11/97<BR></TD>
44 <TD>Another singing algorithm.<BR></TD>
45 </TR>
46 <TR> <TD><A HREF="beer4.bf">beer4.bf</A><BR></TD>
47 <TD>Denis Moskowitz<BR></TD>
48 <TD>4/11/97<BR></TD>
49 <TD>Yet another singing algorithm.<BR></TD>
50 </TR>
51 <TR> <TD><A HREF="beer5.bf">beer5.bf</A><BR></TD>
52 <TD>David Johnston<BR></TD>
53 <TD>4/11/97<BR></TD>
54 <TD>Another singing program.<BR></TD>
55 </TR>
56 <TR> <TD><A HREF="beer6.bf">beer6.bf</A><BR></TD>
57 <TD>Chris Lahey<BR></TD>
58 <TD>4/11/97<BR></TD>
59 <TD>A crammed (14x21) singing program.<BR></TD>
60 </TR>
61 <TR> <TD><A HREF="beer7.bf">beer7.bf</A><BR></TD>
62 <TD>Wim Rijnders<BR></TD>
63 <TD>5/2/97<BR></TD>
64 <TD>A beer bottling program.<BR></TD>
65 </TR>
66 <TR> <TD><A HREF="beer8.bf">beer8.bf</A><BR></TD>
67 <TD>Wim Rijnders<BR></TD>
68 <TD>5/12/97<BR></TD>
69 <TD>Again with the bottles.<BR></TD>
70 </TR>
71 <TR> <TD><A HREF="beer9.bf">beer9.bf</A><BR></TD>
72 <TD>David Johnston<BR></TD>
73 <TD>5/13/97<BR></TD>
74 <TD>Crammed (22x9) singing beer program which doesn't use good grammar or punctuation.<BR></TD>
75 </TR>
76 <TR> <TD><A HREF="befbef.bf">befbef.bf</A><BR></TD>
77 <TD>Wim Rijnders<BR></TD>
78 <TD>5/12/97<BR></TD>
79 <TD>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.<BR></TD>
80 </TR>
81 <TR> <TD><A HREF="befunge1.bf">befunge1.bf</A><BR></TD>
82 <TD>Denis Moskowitz<BR></TD>
83 <TD>7/17/97<BR></TD>
84 <TD>Befunge logo source.<BR></TD>
85 </TR>
86 <TR> <TD><A HREF="befunge2.bf">befunge2.bf</A><BR></TD>
87 <TD>Sam Holden<BR></TD>
88 <TD>7/17/97<BR></TD>
89 <TD>Befunge logo source.<BR></TD>
90 </TR>
91 <TR> <TD><A HREF="befunge3.bf">befunge3.bf</A><BR></TD>
92 <TD>Ben Olmstead<BR></TD>
93 <TD>7/18/97<BR></TD>
94 <TD>Befunge logo source.<BR></TD>
95 </TR>
96 <TR> <TD><A HREF="befunge4.bf">befunge4.bf</A><BR></TD>
97 <TD>Kevin Vigor<BR></TD>
98 <TD>8/13/97<BR></TD>
99 <TD>Befunge logo source.<BR></TD>
100 </TR>
101 <TR> <TD><A HREF="befungex.bf">befungex.bf</A><BR></TD>
102 <TD>Kevin Vigor<BR></TD>
103 <TD>7/18/97<BR></TD>
104 <TD>Non-standard (oversize) Befunge logo source.<BR></TD>
105 </TR>
106 <TR> <TD><A HREF="calc.bf">calc.bf</A><BR></TD>
107 <TD>Bryan L<BR></TD>
108 <TD>4/10/97<BR></TD>
109 <TD>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.<BR></TD>
110 </TR>
111 <TR> <TD><A HREF="cascade.bf">cascade.bf</A><BR></TD>
112 <TD>Chris Pressey<BR></TD>
113 <TD>7/20/97<BR></TD>
114 <TD>Like copyme.bf, but continues to replicate itself.<BR></TD>
115 </TR>
116 <TR> <TD><A HREF="chars.bf">chars.bf</A><BR></TD>
117 <TD>Kalyna Zazelenchuk<BR></TD>
118 <TD>1/1/93<BR></TD>
119 <TD>Generates a printable ASCII table, with characters and corresponding codes in decimal, from 34 to 127.<BR></TD>
120 </TR>
121 <TR> <TD><A HREF="copyme.bf">copyme.bf</A><BR></TD>
122 <TD>Wim Rijnders<BR></TD>
123 <TD>6/5/97<BR></TD>
124 <TD>Program which reproduces itself in Befunge-space.<BR></TD>
125 </TR>
126 <TR> <TD><A HREF="dladv.bf">dladv.bf</A><BR></TD>
127 <TD>Dmitry M Litvinov<BR></TD>
128 <TD>12/1/96<BR></TD>
129 <TD>A minimalist adventure game.<BR>
130 n - go north<BR>
131 s - go south<BR>
132 e - go east<BR>
133 w - go west<BR>
134 d - dress<BR>
135 l - labour<BR></TD>
136 </TR>
137 <TR> <TD><A HREF="drx.bf">drx.bf</A><BR></TD>
138 <TD>Chris Pressey<BR></TD>
139 <TD>1/1/93<BR></TD>
140 <TD>"Like Eliza, except better :-)"<BR></TD>
141 </TR>
142 <TR> <TD><A HREF="ea.bf">ea.bf</A><BR></TD>
143 <TD>Chris Pressey<BR></TD>
144 <TD>1/1/93<BR></TD>
145 <TD>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.<BR></TD>
146 </TR>
147 <TR> <TD><A HREF="easm.bf">easm.bf</A><BR></TD>
148 <TD>Chris Pressey<BR></TD>
149 <TD>1/1/93<BR></TD>
150 <TD>Same as 'ea.bf', but uses self-modifying code.<BR></TD>
151 </TR>
152 <TR> <TD><A HREF="euclid.bf">euclid.bf</A><BR></TD>
153 <TD>Greg Wright<BR></TD>
154 <TD>6/5/97<BR></TD>
155 <TD>Euclidean algorithm.<BR></TD>
156 </TR>
157 <TR> <TD><A HREF="fact.bf">fact.bf</A><BR></TD>
158 <TD>Chris Pressey<BR></TD>
159 <TD>1/1/93<BR></TD>
160 <TD>Asks for a number, and supplies the factorial of that number.<BR></TD>
161 </TR>
162 <TR> <TD><A HREF="fact2.bf">fact2.bf</A><BR></TD>
163 <TD>Jason Reed<BR></TD>
164 <TD>5/18/97<BR></TD>
165 <TD>Factorial generator, (3x12)<BR></TD>
166 </TR>
167 <TR> <TD><A HREF="fact3.bf">fact3.bf</A><BR></TD>
168 <TD>Chris Lahey<BR></TD>
169 <TD>6/8/97<BR></TD>
170 <TD>(23x1) factorial generator.<BR></TD>
171 </TR>
172 <TR> <TD><A HREF="hello.bf">hello.bf</A><BR></TD>
173 <TD>Chris Pressey<BR></TD>
174 <TD>1/1/93<BR></TD>
175 <TD>The ubiquitous "Hello, World!" program.<BR></TD>
176 </TR>
177 <TR> <TD><A HREF="hex.bf">hex.bf</A><BR></TD>
178 <TD>Chris Pressey<BR></TD>
179 <TD>1/1/93<BR></TD>
180 <TD>Translates ASCII input into hex output.<BR></TD>
181 </TR>
182 <TR> <TD><A HREF="hwii.bf">hwii.bf</A><BR></TD>
183 <TD>Chris Pressey<BR></TD>
184 <TD>1/1/93<BR></TD>
185 <TD>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.<BR></TD>
186 </TR>
187 <TR> <TD><A HREF="life.bf">life.bf</A><BR></TD>
188 <TD>Dmitry M Litvinov<BR></TD>
189 <TD>6/1/97<BR></TD>
190 <TD>An implementation of John Conway's game of Life.<BR></TD>
191 </TR>
192 <TR> <TD><A HREF="madd.bf">madd.bf</A><BR></TD>
193 <TD>Greg Wright<BR></TD>
194 <TD>6/5/97<BR></TD>
195 <TD>3x3-Matrix Addition<BR></TD>
196 </TR>
197 <TR> <TD><A HREF="mandel.bf">mandel.bf</A><BR></TD>
198 <TD>Chris Lahey<BR></TD>
199 <TD>4/11/97<BR></TD>
200 <TD>A Mandelbrot fractal generator.<BR></TD>
201 </TR>
202 <TR> <TD><A HREF="maze.bf">maze.bf</A><BR></TD>
203 <TD>Chris Pressey<BR></TD>
204 <TD>1/1/93<BR></TD>
205 <TD>A conversion of a Commodore-64 graphical pastime: a dead-simple random maze generator.<BR></TD>
206 </TR>
207 <TR> <TD><A HREF="namegame.bf">namegame.bf</A><BR></TD>
208 <TD>Dmitry M Litvinov<BR></TD>
209 <TD>2/1/96<BR></TD>
210 <TD>"First, example easy writed stupid prog." Befunge bypasses cultural and lingual backgrounds. Try this "easily written" program and see what it does.<BR></TD>
211 </TR>
212 <TR> <TD><A HREF="numer.bf">numer.bf</A><BR></TD>
213 <TD>Chris Pressey<BR></TD>
214 <TD>1/1/93<BR></TD>
215 <TD>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.)<BR></TD>
216 </TR>
217 <TR> <TD><A HREF="pairing.bf">pairing.bf</A><BR></TD>
218 <TD>Aaron Dale<BR></TD>
219 <TD>3/20/97<BR></TD>
220 <TD>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.<BR></TD>
221 </TR>
222 <TR> <TD><A HREF="pascserp.bf">pascserp.bf</A><BR></TD>
223 <TD>Chris Pressey<BR></TD>
224 <TD>7/12/97<BR></TD>
225 <TD>Generates a gasket (Serpinsky triangle) using Pascal's Triangle.<BR></TD>
226 </TR>
227 <TR> <TD><A HREF="pi.bf">pi.bf</A><BR></TD>
228 <TD>Ben Olmstead<BR></TD>
229 <TD>6/25/97<BR></TD>
230 <TD>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.<BR></TD>
231 </TR>
232 <TR> <TD><A HREF="pi2.bf">pi2.bf</A><BR></TD>
233 <TD>Kevin Vigor<BR></TD>
234 <TD>7/2/97<BR></TD>
235 <TD>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.<BR></TD>
236 </TR>
237 <TR> <TD><A HREF="prime.bf">prime.bf</A><BR></TD>
238 <TD>Kalyna Zazelenchuk<BR></TD>
239 <TD>1/1/93<BR></TD>
240 <TD>Lists the counting numbers incrementally from one and checks if each is prime.<BR></TD>
241 </TR>
242 <TR> <TD><A HREF="rand.bf">rand.bf</A><BR></TD>
243 <TD>Chris Pressey<BR></TD>
244 <TD>1/1/93<BR></TD>
245 <TD>Generates random numbers between 1 and 9 as statistically evenly distributed as the computer's random number generator.<BR></TD>
246 </TR>
247 <TR> <TD><A HREF="rand10.bf">rand10.bf</A><BR></TD>
248 <TD>Ken Bateman<BR></TD>
249 <TD>4/12/97<BR></TD>
250 <TD>A 3x10 random number generator.<BR></TD>
251 </TR>
252 <TR> <TD><A HREF="rand11.bf">rand11.bf</A><BR></TD>
253 <TD>Ken Bateman<BR></TD>
254 <TD>4/12/97<BR></TD>
255 <TD>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.<BR></TD>
256 </TR>
257 <TR> <TD><A HREF="rand12.bf">rand12.bf</A><BR></TD>
258 <TD>Ben Olmstead<BR></TD>
259 <TD>4/24/97<BR></TD>
260 <TD>A 2x13, 0..255 random number generator.<BR></TD>
261 </TR>
262 <TR> <TD><A HREF="rand13.bf">rand13.bf</A><BR></TD>
263 <TD>Ben Olmstead<BR></TD>
264 <TD>4/24/97<BR></TD>
265 <TD>A 2x12, infinitely looping 0..31 random number generator.<BR></TD>
266 </TR>
267 <TR> <TD><A HREF="rand14.bf">rand14.bf</A><BR></TD>
268 <TD>Greg Wright<BR></TD>
269 <TD>5/18/97<BR></TD>
270 <TD>4x7 random number generator.<BR></TD>
271 </TR>
272 <TR> <TD><A HREF="rand15.bf">rand15.bf</A><BR></TD>
273 <TD>Artyom Baranov<BR></TD>
274 <TD>4/5/96<BR></TD>
275 <TD>THE smallest Befunge RNG-16. (16x1)<BR></TD>
276 </TR>
277 <TR> <TD><A HREF="rand2.bf">rand2.bf</A><BR></TD>
278 <TD>Kalyna Zazelenchuk<BR></TD>
279 <TD>1/1/93<BR></TD>
280 <TD>This program, crammed into a 14x14 block, makes random numbers from 1 to 16 using multiple "?" statements.<BR></TD>
281 </TR>
282 <TR> <TD><A HREF="rand3.bf">rand3.bf</A><BR></TD>
283 <TD>Chris Pressey<BR></TD>
284 <TD>1/1/93<BR></TD>
285 <TD>12x9 random number generator, like rand.bf and rand2.bf.<BR></TD>
286 </TR>
287 <TR> <TD><A HREF="rand4.bf">rand4.bf</A><BR></TD>
288 <TD>Matthew D Moss<BR></TD>
289 <TD>2/1/96<BR></TD>
290 <TD>A 7x7 random number generator in the tradition of rand.bf .. rand3.bf, but using mathematics to reduce the problem before writing the code<BR></TD>
291 </TR>
292 <TR> <TD><A HREF="rand5.bf">rand5.bf</A><BR></TD>
293 <TD>Dmitry M Litvinov<BR></TD>
294 <TD>2/1/96<BR></TD>
295 <TD>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.<BR></TD>
296 </TR>
297 <TR> <TD><A HREF="rand6.bf">rand6.bf</A><BR></TD>
298 <TD>Artyom?<BR></TD>
299 <TD>12/1/96<BR></TD>
300 <TD>An 8x4 random number generator a la rand5.bf.<BR></TD>
301 </TR>
302 <TR> <TD><A HREF="rand7.bf">rand7.bf</A><BR></TD>
303 <TD>???<BR></TD>
304 <TD>12/1/96<BR></TD>
305 <TD>A 13x3 random number generator a la rand5.bf and rand6.bf.<BR></TD>
306 </TR>
307 <TR> <TD><A HREF="rand8.bf">rand8.bf</A><BR></TD>
308 <TD>Chris Howe<BR></TD>
309 <TD>4/9/97<BR></TD>
310 <TD>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.<BR></TD>
311 </TR>
312 <TR> <TD><A HREF="rand9.bf">rand9.bf</A><BR></TD>
313 <TD>Chris Lahey<BR></TD>
314 <TD>4/11/97<BR></TD>
315 <TD>A 3x7 random number generator.<BR></TD>
316 </TR>
317 <TR> <TD><A HREF="rdp.bf">rdp.bf</A><BR></TD>
318 <TD>Dmitry M Litvinov<BR></TD>
319 <TD>2/1/96<BR></TD>
320 <TD>A command-line calculator with postfix notation.<BR></TD>
321 </TR>
322 <TR> <TD><A HREF="rdp2.bf">rdp2.bf</A><BR></TD>
323 <TD>Kimberley Burchette<BR></TD>
324 <TD>12/1/96<BR></TD>
325 <TD>A version of rdp.bf crammed into a 23x12 block.<BR></TD>
326 </TR>
327 <TR> <TD><A HREF="robot.bf">robot.bf</A><BR></TD>
328 <TD>Chris Pressey<BR></TD>
329 <TD>1/1/93<BR></TD>
330 <TD>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 '*'.<BR></TD>
331 </TR>
332 <TR> <TD><A HREF="rot13.bf">rot13.bf</A><BR></TD>
333 <TD>???<BR></TD>
334 <TD>9/11/97<BR></TD>
335 <TD>Performs the rot13 algorithm.<BR></TD>
336 </TR>
337 <TR> <TD><A HREF="selflis2.bf">selflis2.bf</A><BR></TD>
338 <TD>Chris Pressey<BR></TD>
339 <TD>12/1/96<BR></TD>
340 <TD>A self-repoducing 80x1 program. This program can also be used to test for the @ vs StringMode bug.<BR></TD>
341 </TR>
342 <TR> <TD><A HREF="selflis3.bf">selflis3.bf</A><BR></TD>
343 <TD>Kevin Vigor<BR></TD>
344 <TD>5/28/97<BR></TD>
345 <TD>A 14-byte Quine (self-reproducing program.)<BR></TD>
346 </TR>
347 <TR> <TD><A HREF="selflis5.bf">selflis5.bf</A><BR></TD>
348 <TD>David Johnston<BR></TD>
349 <TD>5/7/97<BR></TD>
350 <TD>Crammed (14x6) self-listing program.<BR></TD>
351 </TR>
352 <TR> <TD><A HREF="selflis6.bf">selflis6.bf</A><BR></TD>
353 <TD>Denis Moskowitz<BR></TD>
354 <TD>5/8/97<BR></TD>
355 <TD>14-byte quine.<BR></TD>
356 </TR>
357 <TR> <TD><A HREF="selflist.bf">selflist.bf</A><BR></TD>
358 <TD>Andrew Turley?<BR></TD>
359 <TD>12/1/196<BR></TD>
360 <TD>A self-reproducing Befunge program, 13x4.<BR></TD>
361 </TR>
362 <TR> <TD><A HREF="serp.bf">serp.bf</A><BR></TD>
363 <TD>Kevin Vigor<BR></TD>
364 <TD>4/9/97<BR></TD>
365 <TD>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?<BR></TD>
366 </TR>
367 <TR> <TD><A HREF="serp2.bf">serp2.bf</A><BR></TD>
368 <TD>Kevin Vigor<BR></TD>
369 <TD>4/10/97<BR></TD>
370 <TD>Improved Serpinsky Triangle generator.<BR></TD>
371 </TR>
372 <TR> <TD><A HREF="sinus.bf">sinus.bf</A><BR></TD>
373 <TD>Dmitry M Litvinov<BR></TD>
374 <TD>12/1/96<BR></TD>
375 <TD>Program to generate sine wave patterns.<BR>
376 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)<BR></TD>
377 </TR>
378 <TR> <TD><A HREF="sort.bf">sort.bf</A><BR></TD>
379 <TD>Kalyna Zazelenchuk<BR></TD>
380 <TD>1/1/93<BR></TD>
381 <TD>Same as anagram.bf, except sorts the letters of your word in ascending order.<BR></TD>
382 </TR>
383 <TR> <TD><A HREF="surprise.bf">surprise.bf</A><BR></TD>
384 <TD>???<BR></TD>
385 <TD>6/1/97<BR></TD>
386 <TD>A big surprise.<BR></TD>
387 </TR>
388 <TR> <TD><A HREF="switchbx.bf">switchbx.bf</A><BR></TD>
389 <TD>Zach Baker<BR></TD>
390 <TD>7/10/97<BR></TD>
391 <TD>A real purty 'switch' statement.<BR></TD>
392 </TR>
393 <TR> <TD><A HREF="toupper.bf">toupper.bf</A><BR></TD>
394 <TD>Chris Pressey<BR></TD>
395 <TD>9/1/93<BR></TD>
396 <TD>Converts letters to upper-case. An example of the ` (greater) statement.<BR></TD>
397 </TR>
398 <TR> <TD><A HREF="wumpus.bf">wumpus.bf</A><BR></TD>
399 <TD>Wim Rijnders<BR></TD>
400 <TD>8/15/97<BR></TD>
401 <TD>The classic game of Hunt the Wumpus!<BR></TD>
402 </TR>
403 </TABLE></CENTER>
404 </BODY>
405 </HTML>
0 022p25*":ereh drow ruoy retnE">,# :# _>~:25*-#v_v>22g1+:98+-#v_v
1 ^p3g22 p22<
2 0 > ^
3 ***************** v < <
4 0 >22g1+22p>22g1-:22p#v_25*,@
5 0
6 ^ p 3g55"*",<
7 v <
8 >:55p3g:"*"-#^_^
9
10 v ^ <
11 >94+ # ^
12 v < ^
13 # >5* > ^
14 2 6 ^
15 v?vv?v# ?#v?7^
16 999999 # 58 ^
17 76532 >1 ^
18 +++++ v?v ^
19 234 ^
20 >>>>>>>>>>>>>^
0 >84*>:#v_55+"ude.ub@yelruta">:#,_@>188*+>\02p\12p\:22p#v_$ 55+,1- v
1 ^ 0 v +1\ _^#-+*< >22g02g*"_@"*-!1- #v_v>
2 >:>::3g: ,\188 ^^ -1\g21\g22<p3\"_":<
3 ________________________________@_________________________________^ p3\"@":<
0 92+9* :. v <
1 >v"bottles of beer on the wall"+910<
2 ,:
3 ^_ $ :.v
4 >v"bottles of beer"+910<
5 ,:
6 ^_ $ v
7 >v"Take one down, pass it around"+910<
8 ,:
9 ^_ $ 1-v
10 :
11 >v"bottles of beer"+910.:_ v
12 ,:
13 ^_ $ ^
14 >v" no more beer..."+910<
15 ,:
16 ^_ $$ @
0 <"elttob">:#,_$:1- |v
1 v_ #!,#:<" of beer"0<"
2 >"aw eht no ">:#,_v c
3 $ v "llvv, "< ,c
4 1v0,, <"ll<>.":+55< >
5 >-055+".dnuora ti"v ""
6 vv"e down, pass "< s0
7 $v>"no ekaT"55+ ".>v"0
8 >92*3p02p>:#,_$:v p
9 v0.:_ #@# 6#$9 p#<1# <
0 v 99 Bottle of Beer in Befunge
1 < by: "Keith Arner" <keith.arner@netsinc.com> v
2
3 956+* v <>
4 > v "Bottles of Beer on the wall" 0 .:<
5 , :
6 ^ _ $25*, v
7 > v "Bottles of Beer"*25"Take one down, pass it around"0 .:<
8 , :
9 ^ _ $25*, 1 - v
10 > v "Bottles of Beer on the wall" 0 .: <
11 , : > ^
12 ^ _ $25*,25*, : |
13 > v
14
15 > v "Go the the store, buy some more" 0 <
16 , :
17 ^ _ $25*, v
18
19 > v "Bottles of Beer on the wall" 0 .*+569 <
20 , :
21 ^ _ $25*, @
0 9999*++ ^ v,< ,
1 >:.0"elttob" v,< " ""
2 >:|>:| s ta
3 $ $ " p
4 >" reeb fo " ^ >:1- | a
5 ^ "on the wall, "0< v#< ""
6 v p5*29"v"< > v >
7 v < > 055+".dnuor"^> v
8 v v_v#:" of beer."+55 "Take one down,"<
9 vv>#<,:v v , < > 055+55+".l"v>v
10 $ # v v " of beer on the wal"<""
11 ^ < >: | s
12 >">"92*5p v $ >$"<" 29*5pv is
13 v -1 < >#^:_@ ""
0 v by Denis M Moskowitz '97 >"s"v
1 >929+*>:.0"elttob">:#,_$:1-| ,
2 v " of beer on the wall,"0 < <
3 WWW: www.cs.hmc.edu/~dmm/ >"s"v
4 >:#,_$ 52*,:.0"elttob">:#,_$:1- | ,
5 v"nd"* 25_,#! #:<" of beer,"*520< <
6 >"uora ti ssap ,nwod eno ekaT">:#,_$1-:.:v
7 v"s"<
8 , |-1:$_,#! #:<"bottle"0_v
9 v:*250< < 0
10 >".llaw eht no reeb fo ">:#,_$v 5
11 ^ < 2
12 @$_,#! #:<"bottles of beer on the wall."*<
0 v>".llaw eht no reeb "v
1 9 v", "0"bottle"0" of"<
2 9 >"dnuora ti ssap ,n"v
3 * v 001"Take one dow"<
4 2 >".reeb fo "0"eltto"v
5 9 v"n the wall, "01"b"<
6 >"o reeb fo "0"eltt"v
7 * v << <
8 + v > >v> v ^01"bo"<
9 0^_v ,:^"s"< ^000p0 #<
10 0 v< ^_0g1-|v >>v 0
11 p ^< >v 0*,: -
12 0 0>|>>v^ 0<,: 12^_0g1^
13 0 0 >|,:0>v ^_$|5>2*v|<
14 0 g. ^_^,: >|5v,<@
15 >^>^ > ^_^ >^>00g^
0 <:.0"elttob">:v ^
1 v,_v#:< ^,_$:1- |
2 >:^$ ^" of beer"0<
3 v".">0"llaw eht "v,
4 ,v">",<v_v#:<"on",<"
5 5" >,^>:$ ,^ s
6 5< ^", "<55+:"."v "
7 +" v"><"_@# :,,,<
8 ^,> >53p82+6p
9 v>">":53p82+6p1-055+
10 >".dnuora ti ssap"v
11 v"Take one down, "<
12 >:#v_v# <v *9+29<
13 v$ >#<,:^>">"00p
0 5:*4*1- >:1 v
1 v.:<
2 # |:\< <
3 >v"No more "0 < 0
4 ,: :
5 ^_$ v |!-1 <
6 >v"bottle"0< | :,*25<
7 ,: >"s"v@
8 ^_$1- | ,
9 >v" of beer"0< <
10 ,: >v
11 ^_$ :!|
12 >v" on the wall"0<
13 ,: >"."v
14 ^_$ >:2-!|
15 >",">,25*,: |
16 >v"Take one down, pass it around,"0$<
17 ,:
18 ^_$25*,1- :2v
0 ^v3:-1$$_,#! #:<\*52",Take one down, pass it around,"*520 <
1 ^ >0"elttob erom oN">:#,_$"s"\1-#v_$>0"reeb fo ">:#,_$:2-!|
2 >>\:!#^_:.>0"elttob" ^ >, ^
3 ^1:_@#:,,,".":<_v#!-3\*25$_,#! #:<" on the wall"0 <
4 ^2:,,"," <
5 <v1:*9+29
0 c>s10>" llaw eht no "v
1 v2_v#.:g00" of beer" <
2 >0g>"elttob">:#,_$ |
3 v"wn pass it around "<
4 >"od eno ekaT"52*0v!:<
5 v"n the wall"*5201_, ^
6 >"o reeb fo selttob"0v
7 >:v 1<vp00.::-1g0<
8 ^,_$\v ^_>:#,_@
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 <<v "B" "e" < v <#v "e" "!"
1 v < < " " " " " r l
2 :v ,# <e f u n g d c ot
3 > > | * " " " " r b c
4 >,> >25 ^ ^o< ^ < '97 DMM
0 <>: #+1 #:+ 3 : *6+ $#2 9v#
1 v 7 : + 8 \ + + 5 <
2 >- :2 -: " " 1 + \ v ^<
3 2 + : 7 + : 7 + v > :
4 :1- :3- > :#, _ @ >:3 5*-
0 Bef ung e-9 3 r ock s!* #^<
1 ^ $ - 0 1 _ 2 ^ @ <
2 v+ +: :7 : + < * 0 : *<
3 > - 1 1 - v 1 > + , ^
4 >:0 g,: 4 %2- | 8 '97 BEM
0 >:: 09p 1+\ 5 B -!| ^,> v#+
1 * 1 v e f ^ u > 4 7
2 /! >- :0 9 g g , : | >8
3 n v * 6 7 > g @ v < !
4 v5> +6* 9 9e? > ! >$2 5*,
0 009 p^,* 25p9 0 + 1 < ^"n" "ge"
1 v X v > 1 - v* 7 5 <
2 <2g <:, |:X < X :KBV X XB |X-
3 7 X @ > , X 0 9v X X @
4 ^g9 0<BX X ^gg9 < g <"u" "fe"
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 0:02p>~::03p"9"`#v_"0"\` #v_#025**03g"0"-+"#"7v
1 ^ v $< >03g- #v_$03g75*7+1p > >#4
2 +-%*/!.: >8>:2g:#^_$03g9 1+-#v_$" ":3-0p ^ *
3 ^ -1<$< >$002 ^0+1<
0 >011p013p>11g13gg:84*`#v_84*>11g13g4+p$v
1 # 13p^p11 <> ^ >
2 v <
3 # 13pv>11g1+:85*-#^_011p13g1+:4%#^_
0 25*3*4+>:."=",:," "v
1 |-*2*88:+1,,, <
2 @
0 025*"!eM y"v v @# _v#:pg53+g52<
1 >,:v:"Cop" < >1-005p025p59*3+>#$1-: :05g+15gg\^
2 ^ _$015p635p3^p53+1g53p51+1g51_^#:$<
0 052*"*** nooM eht morf epacsE ***">:v v <
1 >v ^,_ v >v
2 "" >:v1 "Big explosion. You're awake in"*25 < ""
3 . ^,_ v er
4 Ne >:v1 "Cage. One rod of South wall is breaking. s>" << 'e
5 od ^,_>~"s"-v sh
6 a ^ _ v T
7 wc >:v1 "Zoo room. Door at East is open. en>" < <o
8 ai>:v ^,_>~:"n"-v n.
9 yr^,_>~"n"-v | -"e"_$ ^ ee
10 .r ^ _ > v t
11 a >:v1 "Corridor. Way lead to North and South. nsw>" < La
12 nB ^,_>~:"w"-v el
13 >" >- |v-"n":_$ ^vP
14 ">^^"s" _$ v e
15 ^ <v"to diving-Dresses room. Sluice at West. dw>" < rg
16 v,_@ >" eloh roolf ni llaF">:v0 _ v .n
17 >:^1 "Vacoom. You're dead."< ^,_~:"w"-!v - i
18 v!-"w"~_, v ^ $_"d"^ ly
19 v_ 1^!:< "Ready to exit. Sluice at West. w>" < el
20 > ">ew .tseW ta etalP gniylF .ecafrus nooM">:v ^ $_"w"v>F | !-"l"<
21 ^,_~:"e"-!^ -""v,_>~:"e"-|
22 ^0 _^>>:^ $
23 ^ <
0 #v #< v
1 >v"Hello... I'm Dr. X. How do you feel today? "0<
2 ,: #
3 ^_$v <
4 >~25*-| > v
5 > 0#v?v
6 ^"Do your friends find this reasonable? "<
7 ^"How long have you felt this way? " <
8 ^"How do you feel about that? " <
9 ^"Are you disturbed by this? " <
0 100p v
1 v"love"0 <
2 v"power"0 <
3 v"strength"0?^#< <
4 v"success"0 ?v
5 v"agony"0 <
6 >v"beauty"0 <>025*"." 1v v_^
7 ,: >00g2- | v< #:
8 ^_,00g1-| >0" fo "3>00p^<
9 >0" eht si "2 ^ >,^
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 >801p 11v
1 v"love" < >+v
2 #v"power" < 1$:
3 v"strength" ?^# <0
4 v"success" ?v g 1
5 v"agony" < 1 p
6 v"beauty" < 0 9
7 v ,<p 1
8 >" eht si ">: |g +
9 >" fo "> v <1 -
10 >25*"."^ >" "10^^_v
11 ^ p91p81:">"<
12
0 501p25*"."v>" fo "v>" eht si "v>:#,_">":03p04p
1 v < < <
2 > ^
3 > ^
4 > ^
5 v
6 v ? v
7 v?v^v?v
8 " " "
9 d"r ""y
10 eee yrn
11 evw vao
12 roo neg
13 glp efa
14 """ """
15 ^>>>>>>>" "001gp01g1-01p
0 501p25*"."v>
1 v <<
2 > >:#,_">": 0^
3 > >" eht si "v
4 > >" fo " ^ <
5 ^p10v#-1g1<v <
6 v ? v >0^3
7 v?v^v?vp p
8 " " "g 0
9 d"r ""y1 4
10 eee yrn0 p
11 evw vao0
12 roo neg"
13 glp efa^
14 """ """"
15 >>>>>>>^
0 v >>:9%00g4p9/:v 0
1 p>:^p00+1g00_$#<%^
2 &&| :\_00g1-00p9*v
3 >^>$.@^!g00+g4g00<
0 v
1 >v"Please enter a number (1-16) : "0<
2 ,: >$*99g1-:99p#v_.25*,@
3 ^_&:1-99p>:1-:!|10 <
4 ^ <
0 vv <>v *<
1 &>:1-:|$>\:|
2 >^ >^@.$<
0 &:>1# -# :_$>\# :#*_$.@
0 v
1 >v"Hello world!"0<
2 ,:
3 ^_25*,@
0 25*"!dlrow ,olleH">:#,_
0 ~:25*-#v_@ > >," ",
1 v < >25*-"A"+v^+"A"-*52<
2 >:82*/:9`| " >,:82*%:9`|
3 >"0"+ #^ ^# +"0"<
0 v <
1 >0#v # "Hello, World!" # v#0 <
2 >v # >v
3 ,: ,:
4 ^_25*,^ ^_25*,^
0 v>>31g> ::51gg:2v++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 9p BXY|-+<v3*89<%+ * * +
2 21 >98 *7^>+\-0|<+ * * +
3 *5 ^:+ 1pg15\,:< + * *** +
4 10^ <>$25*,51g1v+ +
5 -^ p<| -*46p15:+<+ +
6 > 31^> 151p>92*4v+ +
7 ^_ ".", ^ vp1<+ +
8 >v >41p >0 v+ +
9 :5! vg-1g15-1g14<+ +
10 +1-+>+41g1-51gg+v+ +
11 1p-1vg+1g15-1g14<+ +
12 g61g>+41g51g1-g+v+ +
13 14*1v4+g+1g15g14<+ * * +
14 5>^4>1g1+51g1-g+v+ * * +
15 ^ _^v4+gg15+1g14<+ *** +
16 >v! >1g1+51g1+g+v+ +
17 g8-v14/*25-*4*88<+ +
18 19+>g51gg" "- v + +
19 4*5 v< v-2:_3v+ +
20 >^ |!-3_$ v<-+ +
21 ^ < < <|<+ ***+
22 >g51gp ^ >51gp^>v+ +
23 ^14"+"< ^g14"!"<++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
0 001p52*11p6>3>&>:99*%01g11gp99*/:#v_$99*01g1+11gp1-:#v_$1-:#v_$ 001p52*11p v
1 ^ p10+1g10 < @,*25<
2 ^ ^ p10*9+1/9g10 < >001p11g1+11p
3 v v-1\**99\< >*+01g1+01p31g1+31p
4 3>3>021p>031p0>131g>: #^_$01g11g21g+g:99*-#^_$$21g!#v_+.1-:#v_$1-:#v_ ^>
5 ^ v ,*84 p10*9+1/9g10 < >01g9/9*01p321p
6 ^_^# < ,*25 p11+1g11 p100 _^#: <1 <
0 #v 0# 0# 9# p# 0# 1# 9# p# < <
1 < >09g" "-" "**:884**%:79p39p884**/:69p29p v^
2 v9p94p98:/**488p95p99:%**488:**" "-" "g91<
3 v>99**>69g884***79g+::*89g884***99g+:*-"@@"4**/29g884***+39g+:884**%92+9p884*
4 < vp97 :g9+92p98/**488p99%**488:++g95***488g94*2/**4"@@"*+g99***488g98p9+19/*
5 v>19+ 9g:69p884***+:*"@@"4**/89g884***99g+:*"@@"4**/+" "2***`#v_v >
6 > ^ v," "<#> 1-:|
7 >55+,@ v_v#:%*88+1g90$< ,"#" <
8 ^ < ,+55 p91 _^#:%*88+1g91p90>#< 09p
0 v <
1 >?"/",^
2 >"\",^
0 91+00p v
1 >v"What's your name?"*250< > 0v
2 ,: |!`p00:+1g00*88_24g00g4p0v
3 ^_$ >~:00g4p25*- ^
4 >v"Hello, <
5 ,:
6 ^_$25*"!",,@
0 000p>~:25*-!#v_"a"-1+00g+00p>00g9`#v_v
1 @.g00< vp00+%*52g00/*52g00<
2 ^ ># ^# <
0 >0" :eulav X ruoy retnE">,# :# _>&:0`!v> v
1 v_# 0# \# -# < > #- #\ #0 #_^
2 v\<^`0:&$<_ #! #: #,< "Enter your Y value: "0<
3 >1>\:0` #v_$0" = >Y,X<">,# :# _>$\2*1+*1-.25*,@
4 ^\-1\*2\<
0 \$0g\1+\,#:::::::0#$g\#$1g-_0>@>0_-g1$#\g$#0:::::::#,\+1\g0$\
0 58*00p010p>58*00g-|>0g#<1-10gg00g10v
1 v98p00:+1g00< v67<> >1 v+g-1g<
2 >*7+-! #v_v>^^< |%2pg0 1g00:<
3 v p00*58< ^,<^48<>10g!|@
4 >52*,10g1+ :1 0p83 *- ! |
5 v <
0 "^a&EPm=kY}t/qYC+i9wHye$m N@~x+"v
1 "|DsY<"-"z6n<[Yo2x|UP5VD:">:#v_@>
2 -:19+/"0"+,19+%"0"+, ^ >39*
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 =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 =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
1 o >|
2 2 v,,,,, ,,,,,.g22"is prime."<
3 1 > v^ <
4 ^_@#-g11g22p22+1g22,*25<,,,,,,,,,,,,,.g22"is not prime."<
0 =l b93
1 =# quine.bf
2 =# Denis Moskowitz
3 =# 5/8/97
4 =# 14-byte quine.
5 :0g,:93+`#@_1+
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 =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 vv < <
1 2
2 ^ v<
3 v1<?>3v4
4 ^ ^
5 > >?> ?>5^
6 v v
7 v9<?>7v6
8 v v<
9 8
10 . > > ^
11 ^<
0 v> ?<>+?<@
1 >?<4 2 1 .
2 8 >+?<>+^
0 088+>v
1 >+\^1@
2 1 \-.
3 >? ^:\
4 ^+:\_^
0 p8:*:+v/2_g.@
1 0+g00:? :^:p0
0 p8:+ v/2_g.
1 0+g00:? :^p0
0 ?^>v<<^
1 1.+<4 @
2 <<v6?^#
3 8^ 92#<
0 12481> #+?\# _.@
0 v @.<
1 >94+ # ^
2 v < ^
3 # >5* >> ^
4 2 56 ^
5 v?vv?v# ?#^?7^
6 999999 # 8 ^
7 76532 >1 > ^
8 +++++ v2?4 ^
9 3 ^
10 >>>>>>>>>>>>>^
0 7 $^>91+v
1 ?95+vv?94+vv
2 >96+v9>93+v
3 # + ># v<#
4 >>>> >>>.@
5 123 >^456#9
6 ^?^#?#^?^ 7
7 ^ ## < 8 +
8 > > ^# < ^<
0 > v <
1 vv # <
2 14 >0^
3 +*v?1^
4 + >2^p
5 . > 3^1
6 @>"<"1^
0 1v v v v
1 >?>?>?>?>v
2 1+2+4+8+.
3 >^>^>^>^@
0 ?<>>?<8>
1 >>?<>>?<
2 2@4.+<
3 1+ + +<^
0 v >3v@.-1<-<
1 v_4?2>*#v ?1^
2 >:*>1^@.< >2^
0 04v\1_v_v
1 @v?< :2\1
2 .10 -*++
3 ^>>\1^>^>
0 101110v
1 \ v\+1?
2 *2_+.@^
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 =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 vv_v#:"*********"*25< 01 = x coord
1 8,: > ^ 02 = y coord
2 0>^ ^"* * *"*25<
3 1 > ^
4 p ^"* *** * *"*25<
5 2 > ^
6 0 ^"* * *"*25<
7 2 > ^
8 p ^"* * * *"*25<
9 " > ^
10 O ^"* ***** *"*25< >,v
11 " > ^ |:<"You hit a wall! Game over!"0<
12 0 ^"* * *"*25< >25*,@ |-*84gg20g10<
13 1 > ^v ,*62 pg20g10"O"< <
14 g ^"* * *"*25< >00g"w"-|
15 0 > ^ >00g"e"-| >01g1-01p^
16 2 ^"*********"*250< >00g"s"-| >01g1+01p ^
17 g > " "01g02gp "?",~~$:00p"n"-| >02g2+02p ^
18 >p 62*, ^ >02g2-02p ^
0 v,-9-4_v#!`"z":<
1 >~::1+! #@_"m"`|
2 ^<$, < :< -6-7<
3 ^,<+5+8<_v#`"`"<
4 #^_ ^ >:"Z"`#^_:"M"`#^_:"@"`!
0 ">:#,_66*2-,@This prints itself out backwards...... but it has to be 80x1 cells
0 :0g,:93+`#@_1+
0 g,10g,200p1 v<
1 vg,gg01g <p0<0
2 >1+:95*-#^ #<|
3 v+1g01p,*25$ <
4 >:6-#v_@>10p^
5 > ^
0 :0g,:93+`#@_1+
0 v>>0>:04gg,1v
1 0p | -*27:+<
2 04|<>04g1+:0v
3 >^@^-4,*25p4<
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 54*54**52**916p9\:v v " "0
1 v g61\-1_ #< v v " "0
2 v?>53*0v : v " "0
3 5>0>54*>\26p+2/\26gv ^ ,< v " "0
4 >6*^ v"*":p61\/2+< ^_"."^ v " "0
5 >\76*+16gp\:25*%^ v " "0
6 v " "0
7 v " "0
8 +---------------------------+ 5 v " "0
9 |Improved Serpinsky Triangle| 2 v " "0
10 |generator | * v " "0
11 | | , v " "0
12 |4/10/97, Kevin Vigor | \ v " "0
13 +---------------------------+ $ v " "0
14 v " "0
15 v " "0
16 >:v vp\-4*99\"<":< v " "0
17 ^,_$ 25*,1+:54*\`| v " "0
18 $ v " "0
19 @ v " "0
20 ^ ># #< ^
0 100p110p 88*:*8*2- v v <
1 > > : 88*:*8* / 00g* 25*::*8*\4*+ / 58* + >".",1-:|
2 v ,*52,"*"$ <
3 > :: 88*:*8* % 10g* 88*:*8*88*-1+ * \ 88*:*8* / 00g* 25*::**2*3- * - v
4 v / -2*8*:*88 <
5 > \: 88*:*8* / 00g* 88*:*8*88*-1+ * \ 88*:*8* % 10g* 25*::**2*3- * + v
6 v / -2*8*:*88 <
7 > 100p v > 110p v
8 > : 0 ` | > \ : 0 ` | > \ 88*:*8* * + v
9 > 01-00p 0\- ^ > 01-10p 0\- ^
10 ^ <
0 022p25*":ereh drow ruoy retnE">,# :# _>~:25*-#v_v>22g1+:98+-#v_v
1 * ^p3g22 ># ^# p40p22:<
2 * v :g3p44:-1g44<p44+1g22p55"~"< < <
3 ***************** >"*"-#v_ >44g#^_55g,"*"11g3p04g1-:04p#^_25*,@
4 * * v ># #< ^
5 * >:55g`#^_>55p44g11p^
0 v ***********************************
1 * Ctrl-C to exit, Enter to switch *
2 ***********************************
3 > vv " ******* " <vv " ******* " <
4 > " * * * *"52*^ > " * * * *"52*^
5 ^*25"* * * " < ^*25"* * * " <
6 > " ** * *"52*^ > " ** * *"52*^
7 ^*25"* * * * **** " < ^*25"* * * * ****" <
8 > " ***** * *** *"52*^ > "***** * *** *"52*^
9 ^*25"* * ***** " < ^*25"* * *****" <
10 > " *** ******* "52*^> " *** ******* "52*^
11 >92*2->52*>,v >92*2->52*>,v
12 >:!| 1 >:!| 1
13 ^ ,< ^ < - ^ ,< ^ < -
14 |:< |:<
15 >$~ ^ >$~v
16 ^ <
0 ^ ^ ^
1 /-0 -v-1 -v-2 -\
2 |>- ! #^_ :2 v|
3 9^1 : < v- <3
4 < < ^_ ^#!< >!|> >
5 ||<v 4 :<v:< |
6 > > ^ <
7 | -> `! | >4-||
8 < <8v <> :5v> >
9 8>^ >:6-| v-< 4
10 |^_ ^#`7 : _ v |
11 \-7 -^-6 -^-5 -/
12 v v v
0 v, < < <
1 >~:"a"1-`!#^_:"z"1+`#^_"aA"--^
0 0>:48*- #v_$>0145*p0>:045*p:48*1--#v_$7>44*>?< _$++++\1-:#^_v >>^ >
1 ^+1p*73\0:< ^+1 _v#`2g*73:<>:2/ :v >0\2/:^ v< ^"TWANG.."<
2 145*g1+:145*p8 8*` #v_ $> > 44*>?< _$++++:37*g2`!#v_ >
3 >7*p:37*g37*+p^vg*540+1g$#*73g<^$< <>0\2/:^v _v#!`g*540: < # >"rra ehT."^
4 ^3\+1g*73::p*73< >+2*+p# 045*^ ^ < <>:045*g64*1-g-#v_^ >:#,_$$ ^
5 C."*520<p*5400< ^56g*73:g*540:_^#-g*46g*540:_^# -g*2+56g*540:<# v"re A,B,
6 A("25*""v>5*p ^v1$< >025*".niaga gniyrT .sevac gnikam pu dewercS"^>"iF :)CB
7 A,B,C."<^ 41 < _^#:p*7303p*37\5p*37\5p*37\5p*37\4p*37\4p*37\4$<v2"(abc): Move
8 *73g+2* 73:\g*73g+1*73:,*52.+1:g*540$_,#! #:<"Cave "0<$_,#! #:<*5<v30g*73g*46\g
9 540_v#- g-1*46<v"bats."*25_v#g*5440p*54:p*54:p*54:p*5450p*5440p*54< v 4g*
10 vv< > :045*g^>" raeh uoY">545*g!#v_25*".tfard "v>v #"Tunnels lead to:">#<6*g-
11 20_v$_^#!-g+1*73g*540:g*541$_,#! #:<"You feel a" <,:>$":A",,045*g:65+2*g1v^,:*5
12 1>>025*"!supmuw a l" v> `#v_v v_\$37*1++v^_^#v-1*46:,,"B:",*52.+<
13 2v^ $_,#! #:<"You smel"<2v` 2:-"A"$< <!vg\g*540< >g1+.":C"25*,,,64*g1+.">"
14 v>5*,,> ~:25*-!#v_:"a"-:^>#v_:01 vv0:<>`^>:045*p37*g: 4- #v_$025*"!tab tnaig a"
15 <>_#"#^^# $<"0$ _v#!`-<> 1-^v$_,#! #:<"Yo" "u've been snatched by "
16 "ni llef uoY...eeeeeeEEEEEE" "Y">:#,_$@0 >:2/: v> ^ <>5-#v_025*"!tip a ot"
17 \37*g5-#v_ $> $$> $$>$ > >44*>?< _$++++: : 045*g\:145*g\:37*g
18 " net"v">4-!#^_-!#^_-!#^_\0+# 45 *p#^ #1 #<v>0\2/:^#v541g *5\0< >"!supmuw a yb"
19 :#,_$@>"ae neeb ev'uoY...PLUG" ^ >:#,_$^> > ^>*g-#^_025*>?>v>"llik uoY">
20 >37*1++v^"You bumped the wumpus." ^#<^"ed the w"<
21 v40<^"The crafty wumpus dodged your arrow" < "
22 5>0\25*\#v_ #^ #<"!">?<u
23 *^-g*5< >".gnihtyna tih t'ndid wo"vv_$^v"s"< "
24 >g\g14^>_v#" >:2/ :v "0< v<,: >"upm"^