Browse Source

Add README and LICENSE

Mike Schwörer 2 years ago
parent
commit
7fc96a5a2e
Signed by: Mike Schwörer <mailport@mikescher.de> GPG Key ID: D3C7172E0A70F8CF
2 changed files with 129 additions and 0 deletions
  1. 13
    0
      LICENSE.txt
  2. 116
    0
      README.md

+ 13
- 0
LICENSE.txt View File

@@ -0,0 +1,13 @@
1
+        DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE 
2
+                    Version 2, December 2004 
3
+
4
+ Copyright (C) 2004 Sam Hocevar <sam@hocevar.net> 
5
+
6
+ Everyone is permitted to copy and distribute verbatim or modified 
7
+ copies of this license document, and changing it is allowed as long 
8
+ as the name is changed. 
9
+
10
+            DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE 
11
+   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 
12
+
13
+  0. You just DO WHAT THE FUCK YOU WANT TO.

+ 116
- 0
README.md View File

@@ -0,0 +1,116 @@
1
+My Befunge-93 programs
2
+======================
3
+
4
+This is an unsorted collection of some befunge-93 programs I have written.
5
+
6
+Some files contain complete programs and some contain only snippets or modules.
7
+
8
+Notable programs include:
9
+ - sudoku.b93
10
+ - continued_squareroot_fraction.b93
11
+ - gnome_sort.b93
12
+ - Miller-Rabin primality test.b93
13
+ - Sieve-Of-Eratosthenes-with-collector (v2).b93
14
+
15
+Notes
16
+-----
17
+
18
+ - For some of the longer programs (err ... like ... all of them) use [BefunExec](https://github.com/Mikescher/BefunExec) or a similar fast interpreter. *(Your interpreter should support int64 numbers for some programs)*
19
+ - 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).
20
+
21
+Overview
22
+--------
23
+
24
+######Almosted-Sorted-Distinct
25
+Replaces all repeated values in an array with zero.
26
+Works best on (almost) sorted lists (otherwise this is O(n^2))
27
+
28
+######calcBase4Random
29
+Get a random number between 0 and 4^n
30
+
31
+######ConcatenateNumbers
32
+Textually concatenate two numbers (eg: `648 o 120  = 648120`)
33
+
34
+######continued_squareroot_fraction
35
+Calculate the [continued fraction of a square root](https://en.wikipedia.org/wiki/Continued_fraction#Generalized_continued_fraction_for_square_roots)
36
+
37
+######DecodeBase9
38
+Calculates a number where its digits (int base-9) lie reversed on the stack
39
+
40
+######DecodeBase9-2
41
+Calculates a number where its digits (int base-9) lie in normal order on the stack
42
+
43
+######Exponentiation
44
+The Pow() function
45
+
46
+######FacDigitSum
47
+Calculates the sum of the factorials of a digit
48
+
49
+######GenerateRandom
50
+Get a random number between 0 and 4^n
51
+
52
+######GenerateRandom_compressed
53
+Get a random number between 0 and 4^n
54
+
55
+######GetCombinatoricHash
56
+Calculates a combinatoric hash value (the digit order is ignored).
57
+
58
+######gnome_sort
59
+Implementation of [gnome sort](https://de.wikipedia.org/wiki/Gnomesort). Gnome sort is not fast but simple to implement.
60
+
61
+######HelloWorld
62
+Print `hello world`
63
+
64
+######HelloWorld_obfuscated
65
+Print `hello world`
66
+
67
+######Improbable
68
+Runs for a random - but long - time
69
+
70
+######integer-squareroot
71
+Calculates the [integer-squareroot](https://en.wikipedia.org/wiki/Integer_square_root) of a number
72
+
73
+######integer-squareroot-2
74
+Calculates the [integer-squareroot](https://en.wikipedia.org/wiki/Integer_square_root) of a number
75
+
76
+######is-squarenumber
77
+Tests if an integer is a square number (really fast by deploying a number of numerical "tricks")
78
+
79
+######Miller-Rabin primality test
80
+An implementation of the [Miller-Rabin primality test](https://en.wikipedia.org/wiki/Miller-Rabin-Test) for numbers `0 < n < 1,373,653`
81
+
82
+######Miller-Rabin primality test (big)
83
+An implementation of the [Miller-Rabin primality test](https://en.wikipedia.org/wiki/Miller-Rabin-Test) for numbers `0 < n < 3,825,123,056,546,413,051`
84
+
85
+######Primetest
86
+A pretty basic primality test
87
+
88
+######RandomChess
89
+A big cube of `?` instructions
90
+
91
+######RandomChess-2
92
+A big cube of `?` instructions
93
+
94
+######Sieve-Of-Eratosthenes
95
+A implementation of the [sieve of eratosthenes](https://en.wikipedia.org/wiki/Sieve_of_Eratosthenes)
96
+
97
+######Sieve-Of-Eratosthenes-with-collector
98
+A implementation of the [sieve of eratosthenes](https://en.wikipedia.org/wiki/Sieve_of_Eratosthenes) where we collect the found primes in a continuous memory region
99
+
100
+######Sieve-Of-Eratosthenes-with-collector (v2)
101
+A implementation of the [sieve of eratosthenes](https://en.wikipedia.org/wiki/Sieve_of_Eratosthenes) where we collect the found primes in a continuous memory region
102
+
103
+######stack-array-count
104
+Calculate the count of stack values (Null-terminated)
105
+
106
+######stack-array-sum
107
+Generate sum of stack values (Null-terminated)
108
+
109
+######StackReverse
110
+Reverse the values on the stack
111
+
112
+######sudoku
113
+A Sudoku solver (see my [blogpost about this program](https://www.mikescher.com/blog/9/A_complete_sudoku_solver_in_Befunge93))
114
+
115
+######Windmill
116
+A test program for [BefunExec](https://github.com/Mikescher/BefunExec).

Loading…
Cancel
Save