GithubHelp home page GithubHelp logo

mikescher / befungeprograms Goto Github PK

View Code? Open in Web Editor NEW
0.0 3.0 0.0 27 KB

a collection of some befunge programs I have written (see also the collection of my befunge project-euler solutions)

License: Do What The F*ck You Want To Public License

befungeprograms's Introduction

My Befunge-93 programs

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

Notes

  • 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).

Overview

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

######calcBase4Random Get a random number between 0 and 4^n

######ConcatenateNumbers Textually concatenate two numbers (eg: 648 o 120 = 648120)

######continued_squareroot_fraction Calculate the continued fraction of a square root

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

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

######Exponentiation The Pow() function

######FacDigitSum Calculates the sum of the factorials of a digit

######GenerateRandom Get a random number between 0 and 4^n

######GenerateRandom_compressed Get a random number between 0 and 4^n

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

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

######HelloWorld Print hello world

######HelloWorld_obfuscated Print hello world

######Improbable Runs for a random - but long - time

######integer-squareroot Calculates the integer-squareroot of a number

######integer-squareroot-2 Calculates the integer-squareroot of a number

######is-squarenumber Tests if an integer is a square number (really fast by deploying a number of numerical "tricks")

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

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

######Primetest A pretty basic primality test

######RandomChess A big cube of ? instructions

######RandomChess-2 A big cube of ? instructions

######Sieve-Of-Eratosthenes A implementation of the sieve of eratosthenes

######Sieve-Of-Eratosthenes-with-collector A implementation of the sieve of eratosthenes where we collect the found primes in a continuous memory region

######Sieve-Of-Eratosthenes-with-collector (v2) A implementation of the sieve of eratosthenes where we collect the found primes in a continuous memory region

######stack-array-count Calculate the count of stack values (Null-terminated)

######stack-array-sum Generate sum of stack values (Null-terminated)

######StackReverse Reverse the values on the stack

######sudoku A Sudoku solver (see my blogpost about this program)

######Windmill A test program for BefunExec.

befungeprograms's People

Contributors

mikescher avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.