2014-07-10

A lot of you probably know Project Euler.

For those who don't here a short explanation: Project Euler is a collection of mathematical/programming problems. Most problems consist of finding a single number and are solved by writing a program in the programming language of your choice.

Most people solve these by using normal languages like C, Java, Phyton, Haskell etc. But you can also go a step further and try solving it with a little bit more exotic languages.

So here are my solutions written in Befunge

Note:

Similar to most Befunge content on this site I only used the Befunge-93 instruction-set but ignored the 80x25 size restriction.

Still I tries to keep the programs in the Befunge-93 grid size, but that wasn't possible for all. So I guess some programs are technically Befunge-98. Also the original befunge-93 spec didn't specify the word size of the stack or the grid

So, while most programs run happily with 32bit integers some need an interpreter that supports 64bit integers for both stack and grid.

I have a included javascript runner here, but for one I only enabled it for programs of reasonable sizes (a few soutions had source files in the megabyte range).

And also it's not the fastest interpreter and some solution take quite a while to finish.

I recommend using BefunExec. I specially made that interpreter for this project. It can run befunge code with around 6.5 MHz (on my machine)

My favorites:

All solved problems