Brainfuck Interpreter in ZZT-OOP

NOTE: I HATE A LOT OF YOUR ZZT GAMES, SO WATCH OUT!

Moderators: Commodore, Zenith Nadir

Post Reply
duerig
newcomer
Posts: 4
Joined: Mon Nov 12, 2007 5:05 am

Brainfuck Interpreter in ZZT-OOP

Post by duerig »

A while back I wrote a Brainfuck interpreter in ZZT as a programming challenge and for nostalgia's sake. It doesn't really use any special ascii-graphics and it isn't really a game, so I wanted to check before submitting it. Is there any interest?

If you don't know, brainfuck is a minimalistic esoteric programming language. It has a very restricted set of operators while being theoretically equivalent to C, Java, and any other language. See http://esoteric.voxelperfect.net/wiki/Brainfuck for more information.

-D
User avatar
LANCER ECKS
is a lady of leisure and drinks of fine wine
Posts: 51
Joined: Thu Jan 11, 2007 12:32 am

Post by LANCER ECKS »

how long can the bf programs fed into your engine be? and how much memory/stack is provided?
duerig
newcomer
Posts: 4
Joined: Mon Nov 12, 2007 5:05 am

Post by duerig »

It can accept at most 116 BF instructions in a program. (With a slight tweak, this could be increased to 120).

The memory consists of 54 8-bit cells. (Likewise expandable to 60 with a slight modification).

The main limitation is that the only way that I've found of storing the information is using physical walls on the board, which each wall being a bit. Instructions require three bits and memory eight bits. With two banks of instructions, and one of memory, the entire board is pretty much used up.

-D
duerig
newcomer
Posts: 4
Joined: Mon Nov 12, 2007 5:05 am

Post by duerig »

Well, since there was at least one reply, I uploaded it to the archive. When I did, I noticed that I violate the >10kB rule as well. Regardless, until the database is updated and a decision is made as to whether to make an exception in my case, you can find a copy at:

http://www.anotbnotornot.com/brain.zip

The program above also includes a documentation board which describes how the system is implemented for those who are interested. If there are any other questions about it, I will be happy to answer them.

-D
gingermuffins
Posts: 371
Joined: Fri Sep 01, 2006 1:30 am

Post by gingermuffins »

wil wrote one too, but you can't find it by searching brainfuck because it's abbreviated

here:

http://zzt.org/zgames/b/BFI.zip
duerig
newcomer
Posts: 4
Joined: Mon Nov 12, 2007 5:05 am

Post by duerig »

Hmm. I'm a bit disappointed that my interpreter isn't as original as I thought it was. It does have a couple of advantages over wil's, such as displaying your program symbolically rather than as just colors. But wil manages to get 3 bits per square rather than 1.

I thought about how to use that extra information, and I realize that by combining my interpreter with wil's 3-bit storage, I can create a mark 2 version that is vastly improved. It could have up to 644 instructions in a program and 174 9-bit memory locations. These numbers could be adjusted by trading 6 memory cells for 23 code instructions.
User avatar
Commodore
fgsdfs
Posts: 2471
Joined: Wed Mar 12, 2003 5:44 pm
Location: :noitacoL
Contact:

Post by Commodore »

should I be surprised that there are now two bf interpreters in zzt?

yes

at first I was like WTF wil you already did that.
*POW* *CLANK* *PING*
User avatar
Quantum P.
Level 17 Accordion Thief
Posts: 1433
Joined: Fri Sep 12, 2003 1:41 am
Location: Edmonds, WA
Contact:

Post by Quantum P. »

It's hard to be original.

Although you are the first to make a ZZT bf interpreter that uses 8-bit bytes for input/output, as far as I know.
Post Reply