Merge pull request #25 from catseye/cull-and-recontextualize-examples
Cull and recontextualize examples
Chris Pressey authored 3 years ago
GitHub committed 3 years ago

6 | 6 | copyrighted by their original authors. See the file LICENSE for more |

7 | 7 | information. |

8 | 8 | |

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. | |

12 | ||

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`. | |

16 | ||

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. | |

19 | ||

9 | 20 | | Name | License | Author | Date | Notes | |

10 | 21 | | -------------------------- | ------- | ------------------- | -------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | |

11 | 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. |

12 | 23 | | [aturley.bf](aturley.bf) | CC0 | Andrew Turley | 10/30/97 | aturley's .sig; cellular automata gasket generator. |

13 | | [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. | |

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. | |

14 | 25 | | [beer10.bf](beer10.bf) | | Chris Lahey | 6/8/97 | A squashed (22x10) beer singing program, gramatically correct. |

15 | 26 | | [beer2.bf](beer2.bf) | | Keith Arner | 4/10/97 | Another "99 Bottles of Beer" program. |

16 | 27 | | [beer3.bf](beer3.bf) | | Chris Lahey | 4/11/97 | Another singing algorithm. |

20 | 31 | | [beer7.bf](beer7.bf) | CC0 | Wim Rijnders | 5/2/97 | A beer bottling program. |

21 | 32 | | [beer8.bf](beer8.bf) | CC0 | Wim Rijnders | 5/12/97 | Again with the bottles. |

22 | 33 | | [beer9.bf](beer9.bf) | | David Johnston | 5/13/97 | Crammed (22x9) singing beer program which doesn't use good grammar or punctuation. |

23 | | [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. | |

24 | | [befbef2.bf](befbef2.bf) | CC0 | Wim Rijnders | ?/?/100 | A version of befbef.bf with some bugs (pointed out by Amir Karger) fixed. | |

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. | |

25 | 35 | | [befunge1.bf](befunge1.bf) | | Denis Moskowitz | 7/17/97 | Befunge logo source. |

26 | 36 | | [befunge2.bf](befunge2.bf) | | Sam Holden | 7/17/97 | Befunge logo source. |

27 | 37 | | [befunge3.bf](befunge3.bf) | | Ben Olmstead | 7/18/97 | Befunge logo source. |

33 | 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. |

34 | 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. |

35 | 45 | | [copyme.bf](copyme.bf) | CC0 | Wim Rijnders | 6/5/97 | Program which reproduces itself in Befunge-space. |

36 | | [digitalr.bf](digitalr.bf) | | Keymaker | 9/3/108 | Computes the digital root (see numer.bf) of the input. | |

37 | 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. |

38 | 47 | | [drx.bf](drx.bf) | CC0 | Chris Pressey | 9/5/93 | "Like Eliza, except better :-)" |

39 | 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. |

40 | | [easm.bf](easm.bf) | CC0 | Chris Pressey | 9/5/93 | Same as 'ea.bf', but uses self-modifying code. | |

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`. | |

41 | 50 | | [euclid.bf](euclid.bf) | | Greg Wright | 6/5/97 | Euclidean algorithm. |

42 | 51 | | [fact.bf](fact.bf) | CC0 | Chris Pressey | 9/5/93 | Asks for a number, and supplies the factorial of that number. |

43 | 52 | | [fact2.bf](fact2.bf) | | Jason Reed | 5/18/97 | Factorial generator, (3x12) |

54 | 63 | | [mandel.bf](mandel.bf) | | Chris Lahey | 4/11/97 | A Mandelbrot fractal generator. |

55 | 64 | | [maze.bf](maze.bf) | CC0 | Chris Pressey | 9/5/93 | A conversion of a Commodore-64 graphical pastime: a dead-simple random maze generator. |

56 | 65 | | [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. |

57 | | [numer.bf](numer.bf) | CC0 | Chris Pressey | 9/5/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".) | |

66 | | [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".) | |

58 | 67 | | [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. |

59 | 68 | | [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. |

60 | | [pascserp.bf](pascserp.bf) | CC0 | Chris Pressey | 7/12/97 | Generates a gasket (Serpinsky triangle) using Pascal's Triangle. | |

69 | | [pascserp.bf](pascserp.bf) | CC0 | Chris Pressey | 7/12/97 | Generates a gasket (Sierpinsky triangle) using Pascal's Triangle. | |

61 | 70 | | [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. |

62 | | [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. | |

63 | 71 | | [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. |

64 | 72 | | [rand.bf](rand.bf) | | Chris Pressey | 9/5/93 | Generates random numbers between 1 and 9 as statistically evenly distributed as the computer's random number generator. |

65 | 73 | | [rand10.bf](rand10.bf) | | Ken Bateman | 4/12/97 | A 3x10 random number generator. |

66 | 74 | | [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. |

67 | 75 | | [rand12.bf](rand12.bf) | | 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.) |

68 | | [rand13.bf](rand13.bf) | | Ben Olmstead | 4/24/97 | A 2x12, infinitely looping 0..31 random number generator. | |

76 | | [rand13.bf](rand13.bf) | | 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. | |

69 | 77 | | [rand14.bf](rand14.bf) | | Greg Wright | 5/18/97 | 4x7 random number generator. |

70 | 78 | | [rand15.bf](rand15.bf) | | Artyom Baranov | 4/5/96 | THE smallest Befunge RNG-16. (16x1) |

71 | 79 | | [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. |

85 | 93 | | [selflis5.bf](selflis5.bf) | | David Johnston | 5/7/97 | Crammed (14x6) self-listing program. |

86 | 94 | | [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. |

87 | 95 | | [selflist.bf](selflist.bf) | CC0 | Dmitry M Litvinov | 2/21/96 | A self-reproducing Befunge program, 13x4. |

88 | | [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? | |

89 | | [serp2.bf](serp2.bf) | | Kevin Vigor | 4/10/97 | Improved Serpinsky Triangle generator. | |

96 | | [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. | |

90 | 97 | | [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). |

91 | 98 | | [sort.bf](sort.bf) | | Kalyna Zazelenchuk | 9/5/93 | Same as anagram.bf, except sorts the letters of your word in ascending order. |

92 | 99 | | [surprise.bf](surprise.bf) | | Timothy Howe | 11/26/96 | A big surprise. |

93 | | [switchbx.bf](switchbx.bf) | | Zach Baker | 7/10/97 | A real purty 'switch' statement. | |

100 | | [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. | |

94 | 101 | | [testbrdg.bf](testbrdg.bf) | CC0 | Chris Pressey | 10/27/111| Tests whether the \# instruction interacts properly with wrapping. |

95 | 102 | | [testmodu.bf](testmodu.bf) | CC0 | Chris Pressey | 8/23/111 | Tests how your implementation of Befunge-93 calculates modulus (there is no right way.) |

96 | 103 | | [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". |

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 | >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 | 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 | 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 | 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 | ^ ># #< ^⏎ |