Talk:BIO

From Esolang
Jump to navigation Jump to search

There was a problem with the Hello World example, so I fixed it. And here's a shorter version of it: EDIT: Oh yeah, assuming the interpreter strips out all non-BIO symbols...

0ix{1ox;};0iy{1oy;};0ox;0ox;0ox;0ox;0ox;0ox;0ox;0ox;0ox;0ix{0oy;0oy;0o
y;0oy;0oy;0oy;0oy;0oy;1ox;};1iy;0ox;0ox;0ox;0ox;0ox;0ix{0oy;0oy;0oy;0o
y;0oy;1ox;};0oy;0oy;0oy;0oy;1iy;0ox;0ox;0ox;0ix{0oy;0oy;1ox;};0oy;1iy;
1iy;0ox;0ox;0ox;0ix{0oy;1ox;};1iy;0ox;0ox;0ox;0ox;0ox;0ox;0ox;0ox;0ox;
0ix{1oy;1oy;1oy;1oy;1oy;1oy;1oy;1oy;1ox;};1oy;1oy;1oy;1oy;1oy;1oy;1oy;
1iy;0ox;0ox;0ox;0ox;0ox;0ox;0ox;0ix{0oy;0oy;0oy;0oy;0oy;0oy;0oy;1ox;};
0oy;0oy;0oy;0oy;0oy;0oy;1iy;0ox;0ox;0ox;0ox;0ox;0ox;0ix{0oy;0oy;0oy;0o
y;1ox;};1iy;0ox;0ox;0ox;0ix{0oy;1ox;};1iy;0ox;0ox;0ox;0ix{1oy;1oy;1ox;
};1iy;0ox;0ox;0ox;0ox;0ix{1oy;1oy;1ox;};1iy;0ox;0ox;0ox;0ox;0ox;0ox;0o
x;0ox;0ix{1oy;1oy;1oy;1oy;1oy;1oy;1oy;1oy;1ox;};1oy;1oy;1oy;1iy;

--Hyperlisk 17:15, 8 June 2008 (UTC)

I challenge anyone to write a 99 bottles of beer-program in BIO. As far as I see it, it's impossible due to the lack of memory blocks. I would be impressed if anyone could manage to do it :) --Fr34k 19:16, 8 January 2008 (UTC)

It's certainly possible, because BIO is capable of arbitrary output; just write one character at a time, zeroing the relevant block afterwards. More to the point, it's Turing-complete, because it can simulate a Minsky machine; you can get any number of effective counters by using multiplication and division. (Use one block to hold all the counters, starting at 1; one counter is the power of 2 stored there, another is the power of 3, another is the power of 5, and so on using prime numbers for all the counters you need.) --ais523 19:36, 8 January 2008 (UTC)
I would like to see you prove that. BIO only has 3 available memory blocks so I don't see that possible. --Fr34k 19:41, 8 January 2008 (UTC)
But each of them has unbounded storage. --ais523 19:58, 8 January 2008 (UTC)
For more information, see wikipedia:Counter machine#Two-counter machines are Turing equivalent (with a caveat).

--ais523 20:01, 8 January 2008 (UTC)

True, they have.. Well I hope that the implementer works :) I haven't even tested the one for Skull yet (truth to be told, I have no idea how to do it at all) --Fr34k 20:09, 8 January 2008 (UTC)
Done. I made 99 bottles of beer. :D --Hyperlisk 05:42, 9 June 2008 (UTC)
Thats just awesome! :D Congratulations! Though I must say this program language is very ineffective. Good god, juts look at the 99 bottles program. Its HUGE! :D --Fr34k 17:23, 11 June 2008 (UTC)
Heheh, it's probably not as optimized as it can be, I dunno, but it was very fun to write! lol I think the hardest part was trying to figure out how to divide lol. --Hyperlisk 23:27, 11 June 2008 (UTC)

Implementation

I think this is a BIO to Skull compiler (written in Thutu):

/=1/:ASC:=n=x/
/\/\/.*$//
/=;//
/0[Oo][Xx]/={0=[=+1=]%/
/1[Oo][Xx]/={0=[=-1=]%/
/0[Oo][Yy]/={1=[=+1=]%/
/1[Oo][Yy]/={1=[=-1=]%/
/0[Oo][Zz]/={2=[=+1=]%/
/1[Oo][Zz]/={2=[=-1=]%/
/0[Ii][Xx]/={0/
/0[Ii][Yy]/={1/
/0[Ii][Zz]/={2/
/1[Ii][Xx]/=|0=|/
/1[Ii][Yy]/=|1=|/
/1[Ii][Zz]/=|1=|/
/=}/%%/
/=n/=9/!
  /=x/=n=x/
.
/%/@
  /%/=}/
.

I haven't compiled all the way to an executable, though, so this is currently only half-tested. --ais523 19:58, 8 January 2008 (UTC)