- Befunge 98 with concurrency and file io!

This commit is contained in:
Wim Pomp
2022-11-26 20:05:58 +01:00
parent 91462bea57
commit 1429c32976
27 changed files with 621 additions and 233 deletions

12
examples/99.bf Executable file
View File

@@ -0,0 +1,12 @@
#!/usr/bin/env befunge
992+*: v: <
v" ".:<_091+".reeb fo selttob erom on ,llaw eht no reeb fo selttob erom oN">:v
,v"Go to the store and buy some more, 99 bottles of beer on the wall."+910<^,_v
>:#,_@>:101-*+v >$0" ,llaw eht no reeb fo ">:#,_$:.1v ^ $<
>0\ >> ^ v_0"elttob">:#,_$\:!| >091+".reeb fo ">:#,_$ v
>0"selttob"^ >1-!| >" ",\v
>$2\ ^\2<," ".< >091+:".llaw eht no reeb fo "v
^_v > ^ |:< v!:<"Take one down and pass it around, "0< v!:<
!,v ^ ^:-1$_, ^ v$_>,^
>^ ^ <
^:<"no more "0< > ^

4
examples/cat_v.bf Executable file
View File

@@ -0,0 +1,4 @@
#!/usr/bin/env befunge
w4110'vin10
"<v"
>>#,:#<_@

3
examples/concurrent.bf Executable file
View File

@@ -0,0 +1,3 @@
#!/usr/bin/env befunge
v
@000_1t111@

9
examples/dna.bf Executable file
View File

@@ -0,0 +1,9 @@
#!/usr/bin/env befunge
7^DN>vA
v_#v? v
7^<""""
3 ACGT
90!""""
4*:>>>v
+8^-1,<
> ,+,@)

0
examples/ex1.bf Normal file → Executable file
View File

0
examples/factorial.bf Normal file → Executable file
View File

2
examples/factorial0.bf Normal file → Executable file
View File

@@ -1,5 +1,5 @@
#!/usr/bin/env befunge
v
0
&
>>:1v
|:-<

3
examples/factorial_eso.bf Executable file
View File

@@ -0,0 +1,3 @@
#!/usr/bin/env befunge
&>:1-:v v *_$.@
^ _$>\:^

1
examples/factorial_heap.bf Normal file → Executable file
View File

@@ -1,2 +1,3 @@
#!/usr/bin/env befunge
&:>00p1-::v
^ *g00 _g.25*,@

2
examples/fibonacci.bf Executable file
View File

@@ -0,0 +1,2 @@
#!/usr/bin/env befunge
j1\:b0p+:.' 1

25
examples/guess.bf Executable file
View File

@@ -0,0 +1,25 @@
#!/usr/bin/env befunge
vv < <
2
^ v<
v1<?>3v4
^ ^
> >?> ?>5^
v v
v9<?>7v6
v v<
8
> > ^
vv < <
2
^ v<
v1<?>3v4
^ ^
> >?> ?>5^
v v v ,*25 <<
v9<?>7v6 ,,
v v< ""
8 ><
> > ^ ""v
>*: >0"!rebmun tupnI">:#,_$25*,:&:99p`|^< _0"!niw uoY">:#,_$25*,@
^ < >:99g01-*+^

16
examples/guess2.bf Executable file
View File

@@ -0,0 +1,16 @@
#!/usr/bin/env befunge
v>>> > v>>> > v
012 3 012 3
^?^ ^?^
>>?#v?4>>?#v?4v
v?v v?v
98765 98765
>>>>> ^>>>>> v
v 0 + * + : 5 <
>"!sseuG">:#,_v
0v_v#:-&:,+:5$<
, v>0"!niw uoY"
+0>:#,_$5:+,@
:>`0\"!"\v
v"small"_"gib"
^>" ooT">:#,_$5

2
examples/hello_b98.bf Executable file
View File

@@ -0,0 +1,2 @@
#!/usr/bin/env befunge
<>:#,_# @#"Hello, World!"

0
examples/hello_world.bf Normal file → Executable file
View File

0
examples/hello_world2.bf Normal file → Executable file
View File

9
examples/mill.bf Executable file
View File

@@ -0,0 +1,9 @@
#!/usr/bin/env befunge
] v
>v
v?t1?
1 t
t 1
?1t?v
v< <
>29*y.@

0
examples/multiplier.bf Normal file → Executable file
View File

4
examples/pi.bf Executable file
View File

@@ -0,0 +1,4 @@
#!/usr/bin/env befunge
"^a&EPm=kY}t/qYC+i9wHye$m N@~x+"v
"|DsY<"-"z6n<[Yo2x|UP5VD:">:#v_@>
-:19+/"0"+,19+%"0"+, ^ >39*

2
examples/quine1.bf Executable file
View File

@@ -0,0 +1,2 @@
#!/usr/bin/env befunge
01->1# +# :# 0# g# ,# :# 5# 8# *# 4# +# -# _@

0
examples/random.bf Normal file → Executable file
View File

6
examples/random_n.bf Executable file
View File

@@ -0,0 +1,6 @@
#!/usr/bin/env befunge
& :v>00g2/.@
v00_^#!`/2g00:<
>0p:1>>:10p` !|
>+00p^?<*2g01:<
^ g00:<

5
examples/sieve.bf Executable file
View File

@@ -0,0 +1,5 @@
#!/usr/bin/env befunge
2>:3g" "-!v\ g30 <
|!`"O":+1_:.:03p>03g+:"O"`|
@ ^ p3\" ":<
2 234567890123456789012345678901234567890123456789012345678901234567890123456789

23
examples/soup.bf Executable file
View File

@@ -0,0 +1,23 @@
#!/usr/bin/env befunge
060p070 p'O80v
pb2*90p4$4> $4$>v>
v4$>4$>4$>4$># ARGH>!
<{[BEFUNGE_97]}> FUNGE!
##:-:## #####* 4$*>4$ >060p> 60g80g -!#v_ 60g1+ 60p60v
#vOOGAH **>4$>^!!eg nufeB^ $4$4$4 $4<v#<<v-*2a:: v7-1g<
#>70g>90g-! #@_^Befunge!! 123456 123456 VvVv!#!>Weird! >0ggv*
^$4$4p07+1g07 ,a<$4< <$4$4< <$4$4< <$4$4< <<#<*-=-=-=-=-* -=-=v*
::48*-#v_>,4$> 4$4$4 $4$4$ 4$4$4$ 4$4$4$ 4$^*!* XXXXXX XXX>
BOINK>$60g1-7 0g+d2* %'A+,1 $1$1$1 $1$1$1 $>^<$ HAR!!! 8888
Befunge_is such_a pretty langua ge,_is n't_i t?_It_ 8888
looks_so much_l ike_li ne_noi se_and it's_ STILL_ 88
Turing- Complet e!_Cam ouflag e_your code!! Confu se_the
hell_out of_every one_re ading_ your_co de._Oh, AND_y ou.:-) ,o88o.
Once_this_thing_i s_code d,_rea ding_it_back_ver ges_on the_imp 888888
ossible._Obfusc ate_the_obfus cated!_Befunge_ debuggers_are__ 888888
your_friends! By:_Alexios Chouchou las... X-X-X-X-X-X-X! 888888
-=*##*=- \*****/ 9797* -=97=- !@-*= ***** "88P
*!@-*
=*!@-
-=*!@
@-=*!

2
examples/test.bf Executable file
View File

@@ -0,0 +1,2 @@
#!/usr/bin/env befunge
45*1-y>>#,:#<_$:w@

1
examples/v Executable file
View File

@@ -0,0 +1 @@
Hello world!