You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

This is an unsorted collection of some befunge-93 programs I have written.

Some files contain complete programs and some contain only snippets or modules.

Notable programs include:

- sudoku.b93
- continued_squareroot_fraction.b93
- gnome_sort.b93
- Miller-Rabin primality test.b93
- Sieve-Of-Eratosthenes-with-collector (v2).b93

- For some of the longer programs (err … like … all of them) use BefunExec or a similar fast interpreter.
*(Your interpreter should support int64 numbers for some programs)* - I generally like to write Befunge-93 syntax. Unfortunately the ‘93 variant is not turing complete due to its restriction of a 80x25 size. I simply chose to ignore that restriction in the programs where I hit the limit (but I still try to compress my programs as much as possible). You could argue that - because of that - some programs are technically Befunge-98 (with a severe limited instruction set).

Replaces all repeated values in an array with zero. Works best on (almost) sorted lists (otherwise this is O(n^2))

Get a random number between 0 and 4^n

Textually concatenate two numbers (eg: `648 o 120 = 648120`

)

Calculate the continued fraction of a square root

Calculates a number where its digits (int base-9) lie reversed on the stack

Calculates a number where its digits (int base-9) lie in normal order on the stack

The Pow() function

Calculates the sum of the factorials of a digit

Get a random number between 0 and 4^n

Get a random number between 0 and 4^n

Calculates a combinatoric hash value (the digit order is ignored).

Implementation of gnome sort. Gnome sort is not fast but simple to implement.

Print `hello world`

Print `hello world`

Runs for a random - but long - time

Calculates the integer-squareroot of a number

Calculates the integer-squareroot of a number

Tests if an integer is a square number (really fast by deploying a number of numerical “tricks”)

An implementation of the Miller-Rabin primality test for numbers `0 < n < 1,373,653`

An implementation of the Miller-Rabin primality test for numbers `0 < n < 3,825,123,056,546,413,051`

A pretty basic primality test

A big cube of `?`

instructions

A big cube of `?`

instructions

A implementation of the sieve of eratosthenes

A implementation of the sieve of eratosthenes where we collect the found primes in a continuous memory region

A implementation of the sieve of eratosthenes where we collect the found primes in a continuous memory region

Calculate the count of stack values (Null-terminated)

Generate sum of stack values (Null-terminated)

Reverse the values on the stack

A Sudoku solver (see my blogpost about this program)

A test program for BefunExec.