Befunge-98

Befunge is a two-dimensional esoteric programming language invented in 1993 by Chris Pressey with the goal of being as difficult to compile as possible.

The objective of this contest is to write a Befunge runner (whether that be an interpreter, bf->lua translator, or otherwise) in Lua 5.1

Your code is expected to create the function run(code) where code is a Befunge-98 source. The code argument will be a string. Lines are separated by "\n".

For input/output, it is recommended to use io.read(1) and io.write("text\n")

Examples

The following will be tested (along with others) and expect to run.

Hello world

                 v
>v"Hello world!"0<
,:
^_25*,@

The previous code will be run as

run('                 v\n>v"Hello world!"0<\n,:\n^_25*,@')

99 bottles of beer

92+9*                           :. v  <
>v"bottles of beer on the wall"+910<
,:
^_ $                             :.v
            >v"bottles of beer"+910<
            ,:
            ^_ $                     v
>v"Take one down, pass it around"+910<
,:
^_ $                           1-v
                                 :
        >v"bottles of beer"+910.:_          v
        ,:
        ^_ $                          ^
                    >v" no more beer..."+910<
                    ,:
                    ^_ $$ @

Prize

A ticket to BlizzCon 2009. You must be at least 18 years of age in order to participate in this contest. If you participate in another contest on WowAce/CurseForge for a BlizzCon 2009 ticket, you will only be able to redeem one. You must use the ticket for yourself or you may gift it to another author (i.e. not just your girlfriend), not for resale. We will not be paying travel costs. You must be an author on either CurseForge or WowAce to participate.

Runners-up will receive 500 Curse Points or 1 year of free Curse Premium of a user of your choosing. If you choose to opt out of a BlizzCon ticket, you may still be a Runner-up.

Other info

We have the right to revoke your right to participate at any time.

Your submission must be completely your own work, you're free to use resources to figure out how you would code the solution, as long as all the code is your own.

Your submission must run in Lua 5.1.4, in a standalone environment (not in WoW). You cannot use any external libraries outside of what Lua itself provides.

Winner

john Howard by cyrnus

Interesting implementation, though mostly the winner because the others didn't want the BlizzCon ticket.

Facts

Started
22 May 2009
Closing
15 Jun 2009
Judging finished
16 Jun 2009
Entries
4
Type
Code
Stage
Finished - Contest is finished and winners have been chosen.
Code language
Lua