PDA

Click to See Complete Forum and Search --> : Anybody heard of a language called Brainf***?


HarryW
Nov 20th, 2000, 04:41 PM
Here's a quick snippet of code that apparently produces the lyrics to "99 bottles of beer on the wall":

>+++++++++[<+++++++++++>-]<[>[-]>[-]<<[>+>+<<-]>>[<<+>>-]>>>
[-]<<<+++++++++<[>>>+<<[>+>[-]<<-]>[<+>-]>[<<++++++++++>>>+<
-]<<-<-]+++++++++>[<->-]>>+>[<[-]<<+>>>-]>[-]+<<[>+>-<<-]<<<
[>>+>+<<<-]>>>[<<<+>>>-]>[<+>-]<<-[>[-]<[-]]>>+<[>[-]<-]<+++
+++++[<++++++<++++++>>-]>>>[>+>+<<-]>>[<<+>>-]<[<<<<<.>>>>>-
]<<<<<<.>>[-]>[-]++++[<++++++++>-]<.>++++[<++++++++>-]<++.>+
++++[<+++++++++>-]<.><+++++..--------.-------.>>[>>+>+<<<-]>
>>[<<<+>>>-]<[<<<<++++++++++++++.>>>>-]<<<<[-]>++++[<+++++++
+>-]<.>+++++++++[<+++++++++>-]<--.---------.>+++++++[<------
---->-]<.>++++++[<+++++++++++>-]<.+++..+++++++++++++.>++++++
++[<---------->-]<--.>+++++++++[<+++++++++>-]<--.-.>++++++++
[<---------->-]<++.>++++++++[<++++++++++>-]<++++.-----------
-.---.>+++++++[<---------->-]<+.>++++++++[<+++++++++++>-]<-.
>++[<----------->-]<.+++++++++++..>+++++++++[<---------->-]<
-----.---.>>>[>+>+<<-]>>[<<+>>-]<[<<<<<.>>>>>-]<<<<<<.>>>+++
+[<++++++>-]<--.>++++[<++++++++>-]<++.>+++++[<+++++++++>-]<.
><+++++..--------.-------.>>[>>+>+<<<-]>>>[<<<+>>>-]<[<<<<++
++++++++++++.>>>>-]<<<<[-]>++++[<++++++++>-]<.>+++++++++[<++
+++++++>-]<--.---------.>+++++++[<---------->-]<.>++++++[<++
+++++++++>-]<.+++..+++++++++++++.>++++++++++[<---------->-]<
-.---.>+++++++[<++++++++++>-]<++++.+++++++++++++.++++++++++.
------.>+++++++[<---------->-]<+.>++++++++[<++++++++++>-]<-.
-.---------.>+++++++[<---------->-]<+.>+++++++[<++++++++++>-
]<--.+++++++++++.++++++++.---------.>++++++++[<---------->-]
<++.>+++++[<+++++++++++++>-]<.+++++++++++++.----------.>++++
+++[<---------->-]<++.>++++++++[<++++++++++>-]<.>+++[<----->
-]<.>+++[<++++++>-]<..>+++++++++[<--------->-]<--.>+++++++[<
++++++++++>-]<+++.+++++++++++.>++++++++[<----------->-]<++++
.>+++++[<+++++++++++++>-]<.>+++[<++++++>-]<-.---.++++++.----
---.----------.>++++++++[<----------->-]<+.---.[-]<<<->[-]>[
-]<<[>+>+<<-]>>[<<+>>-]>>>[-]<<<+++++++++<[>>>+<<[>+>[-]<<-]
>[<+>-]>[<<++++++++++>>>+<-]<<-<-]+++++++++>[<->-]>>+>[<[-]<
<+>>>-]>[-]+<<[>+>-<<-]<<<[>>+>+<<<-]>>>[<<<+>>>-]<>>[<+>-]<
<-[>[-]<[-]]>>+<[>[-]<-]<++++++++[<++++++<++++++>>-]>>>[>+>+
<<-]>>[<<+>>-]<[<<<<<.>>>>>-]<<<<<<.>>[-]>[-]++++[<++++++++>
-]<.>++++[<++++++++>-]<++.>+++++[<+++++++++>-]<.><+++++..---
-----.-------.>>[>>+>+<<<-]>>>[<<<+>>>-]<[<<<<++++++++++++++
.>>>>-]<<<<[-]>++++[<++++++++>-]<.>+++++++++[<+++++++++>-]<-
-.---------.>+++++++[<---------->-]<.>++++++[<+++++++++++>-]
<.+++..+++++++++++++.>++++++++[<---------->-]<--.>+++++++++[
<+++++++++>-]<--.-.>++++++++[<---------->-]<++.>++++++++[<++
++++++++>-]<++++.------------.---.>+++++++[<---------->-]<+.
>++++++++[<+++++++++++>-]<-.>++[<----------->-]<.+++++++++++
..>+++++++++[<---------->-]<-----.---.+++.---.[-]<<<]


Now if you didn't know about this language before, you'll see where it gets its name. So what the f*** is all that code about eh? I figure it's something to do with pushes and pops, or shifts, or.... f*** knows.

Anyone met this curious language before?

kovan
Nov 20th, 2000, 04:49 PM
[blinded people]
i checked the Qur'an, i coudn't find it so its not a language
[/blinded people]

Nov 20th, 2000, 04:50 PM
I've seen it before... it's supposed to confuse dumb people and make them tell religious jokes that nobody laughs at...

kovan
Nov 20th, 2000, 04:57 PM
your still funny :)

barrk
Nov 20th, 2000, 04:58 PM
Isn't that what all you guys try to do to each other on this Chit-Chat Forum????

HarryW
Nov 20th, 2000, 05:08 PM
Well if your brain survived that one, try this out, it's a language called Befunge:


----- begin beer.bf -----
v v0\1:\1:\0\0\!:p15-< Bottles of Beer for Befunge
0 \ {befunge} >" ekaT">v written by Brian Raiter, 5/97
0>>.0"llaw eht no "v<#,: breadbox@muppetlabs.com
"\, >"eno"^>0 #"^1^_v
c1,>51g#^_"ti"^. >vr : $
"::^" down, pass "^|\*25,<^ # i e ^g1<
,>052*":dnuor t"vbv:<
v0_^ . , ^< " "
>52*".ll"v >,^ fb e
v"aw eht no r"v
""" ,: >" ;"^ f ^<@
meo >^"bottle"< "o $
o m^"re:"52*^>"s"^v"les"<,:
"^< ^"99 bott"< >^>^<
>" yub ,erots eht ot oG"^
------ end beer.bf ------


Notice that some of the strings are written backwards.

.yhw aedi on evah I

Sam Finch
Nov 20th, 2000, 05:45 PM
where exactly did you find these languages, they look like they were written by an expert panel of mental patients.

HarryW
Nov 20th, 2000, 05:54 PM
I found them here (http://www.ionet.net/~timtroyr/funhouse/beer.html).

kedaman
Dec 2nd, 2000, 04:35 AM
<-------<
>-------<
>------<
>---<
<-------<
<---->
<----->
<-------<
>-------<
>------<
>-------<
<---------------<
<------<
>----<
<------->
>----<
<---------->
<---->
<------>
>--------->
<------<
>-<
>------<
>------<

Guess what this does?

HarryW
Dec 2nd, 2000, 05:00 AM
Confuses me?

G.Kumaraguru
Dec 2nd, 2000, 05:58 AM
This is the left over food of a shark in an aquarium.

Sam Finch
Dec 2nd, 2000, 06:29 AM
it puts some -ve numbers into memory.

kedaman
Dec 2nd, 2000, 07:39 AM
it shows a diagram of my sleeping habits :p

Fox
Dec 2nd, 2000, 07:55 AM
I like Orthogonal (http://www.ionet.net/~timtroyr/funhouse/beer/beer_n_r.html#orthogonal) better ;)

Fox
Dec 2nd, 2000, 08:17 PM
Kedaman: A Hello World program?

or:

Hm, what this does... maybe: Confusing us? ;)

kedaman
Dec 3rd, 2000, 12:33 AM
Hello Fox program actually!
nope, as i said, it does something more than that :)
Can be translated to visual smiley code too:
:rolleyes: :D :) :D :p :o :rolleyes: :) :eek: ;)

Fox
Dec 3rd, 2000, 11:51 AM
No idea ;) I hate these difficult languages... why can't you just use Orthogonal? :D

HarryW
Jan 28th, 2001, 12:21 AM
Hey, I just remembered this thread and thought I'd add another language that makes my ears bleed.... I hope yours do too. Enjoy! :)


>9999*++000s1100sXv< >#v100g5-v
X >100g3- |v _@
|-2g001_ v
v *39s1010pg000 s0012-#< <
vv*35s1010pg000< 1
v## *47s1011s0014g# <
v*35s10103100sv 0
^ < 1
^
{
000 > x
v s100+1g100 <
>001g101g9gp001g201g -|
s 0
1 0
0 0
2 xv# < 1
^ >000v s
v0pg< P
0 x
g
^_5100s^
{
100 bottles of beer.
{
In BefDC - a derivative of Befudge and dc, by Sam Holden
{
This code by Sam Holden, 1997.
{
Note: this language was actually designed to do my cryptography assigments,
which is why it is defined with 'infinite' precision math.
{
{
{
{
bottles of beer on the wall
Take one down, pass it around

Jan 28th, 2001, 04:15 AM
Ever heard of a language called Intercal?

Every statement must start with the phrase PLEASE !

Otherwise the error message generated is "The programmer is insufficiently polite"..

Smart ?

Jan 28th, 2001, 04:29 AM
Heres a sample Intercal program


DO (5) NEXT
(5) DO FORGET #1
PLEASE WRITE IN :1
DO .1 <- '?":1~'#32768$#0'"$#1'~#3
DO (1) NEXT
DO :1 <- "'?":1~'#65535$#0'"$#65535'
~'#0$#65535'"$"'?":1~'#0$#65535'"
$#65535'~'#0$#65535'"
DO :2 <- #1
PLEASE DO (4) NEXT
(4) DO FORGET #1
DO .1 <- "?':1~:2'$#1"~#3
DO :1 <- "'?":1~'#65535$#0'"$":2~'#65535
$#0'"'~'#0$#65535'"$"'?":1~'#0
$#65535'"$":2~'#0$#65535'"'~'#0$#65535'"
DO (1) NEXT
DO :2 <- ":2~'#0$#65535'"
$"'":2~'#65535$#0'"$#0'~'#32767$#1'"
DO (4) NEXT
(2) DO RESUME .1
(1) PLEASE DO (2) NEXT
PLEASE FORGET #1
DO READ OUT :1
PLEASE DO .1 <- '?"':1~:1'~#1"$#1'~#3
DO (3) NEXT
PLEASE DO (5) NEXT
(3) DO (2) NEXT
PLEASE GIVE UP


Note the last line (he he)

Here is an excerpt from its manual...

2.2 Uses for INTERCAL
INTERCAL's main advantage over other programming languages is its strict simplicity. It has few capabilities, and thus there are few restrictions to be kept in mind. Since it is an exceedingly easy language to learn, one might expect it would be a good language for initiating novice programmers. Perhaps surprising, than, is the fact that it would be more likely to initiate a novice into a search for another line of work. As it turns out, INTERCAL is more useful (which isn't saying much) as a challenge to professional programmers.


Want to know more about Intercal? You just need to post a reply!! :)

HarryW
Jan 28th, 2001, 05:05 AM
Is that a threat?

kedaman
Mar 1st, 2001, 07:51 AM
took me an hour to make this befunge app:

v >*"namadek"v
2 5 v,_v#<:< <
5 2 >:^$
* 0 v< >"eb"^
>1|:-1<|:<^"fung"<
>0"!!!looc s'e"^
@

guess what this does?

CyberSurfer
Mar 1st, 2001, 08:12 AM
Does it print "Kedaman" to the screen?

kedaman
Mar 1st, 2001, 08:28 AM
yep, but it does more than that :)

v
v v
v?<?>?v
12 v 56
v<3?4>v
>.@^@.<


? v @#
? 1v4
? 2v5
?3v6
>^^^
vvvvv.

i wrote two other apps just for the fun of it, they do the exact same thing though.

kedaman
Mar 1st, 2001, 08:50 AM
the last one has a bug, it should be

? vv @#
? 1v4
? 2v5
## ?3v6
>v .

and now it's the most compact one too :)

amesjustin
Mar 1st, 2001, 05:59 PM
Don't all women speak Brainf**k?

HarryW
Mar 1st, 2001, 06:40 PM
Less of a language, more of a lifestyle.

Mar 1st, 2001, 07:28 PM
Originally posted by kedaman
the last one has a bug, it should be

? vv @#
? 1v4
? 2v5
## ?3v6
>v .

and now it's the most compact one too :)

Where did you learn to write that?!? :confused:

kedaman
Mar 1st, 2001, 08:32 PM
I looked up befunge on altavista and found some source, forgot to bookmark it though, befunge is really cool once you learn it :p
the sixth and last version of befungdice i made looks like this:

?1v>#3v#
>5>?1+>.@

yep it prints a random number from 1 to 6

HarryW
Mar 1st, 2001, 10:53 PM
"You're weird." -- John Cleese as Roman Centurion, Life of Brian