Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Updated README

  • Loading branch information...
commit 706caf0b0ff3f045a1fd3430b81777144dc9238c 1 parent 6b47079
Daniel Holden authored
Showing with 9 additions and 12 deletions.
  1. +3 −0  MAIN.h
  2. +6 −12 README.md
View
3  MAIN.h
@@ -0,0 +1,3 @@
+#include "COMPLETE.h"
+
+BRAINFUCK(STDIN)
View
18 README.md
@@ -2,15 +2,16 @@
BRAINFUCK
=========
-What I believe is the first absolute proof that the C preprocessor is turing complete. This uses no GCC extensions and other than the rules for macro evaluation the only "features" it takes advantage of are token pasting and variable argument number macros.
+A Brainfuck interpreter written in the C preprocessor.
-The proof method is simple - a Brainfuck interpreter written in the C preprocessor.
+There has been much speculation but I believe this is the first absolute proof that the C preprocessor is turing complete. If anyone knows any better please say so! This uses no GCC extensions and other than the rules for macro evaluation the only "features" it takes advantage of are token pasting and VA_ARG macros.
Compiling
---------
-As the standard bainfuck symbols are invalid preprocessor tokens they have been mapped to the following characters. Interactive input is also disabled as this is unsupported by the C preprocessor.
+As the standard bainfuck symbols are invalid preprocessor tokens they have been mapped to the following characters. Interactive input is also disabled as this is unsupported by the C preprocessor. I am also yet to implement square bracket matching but this will be coming soon.
+
* `>` => `R`
* `<` => `L`
@@ -20,11 +21,9 @@ As the standard bainfuck symbols are invalid preprocessor tokens they have been
* `[` => `F`
* `]` => `B`
-For now, square brackets are also unmatched but this is a quick and easy to make improvement.
-
Then a program can be compiled as so:
-* `cpp MAIN_BF.h -D STDIN=(U,U,U,U,U,U,U,U,U,U,F,R,U,U,U,U,U,U,U,R,U,U,U,U,U,U,U,U,U,U,R,U,U,U,R,U,L,L,L,L,D,B,R,U,U,O,R,U,O,U,U,U,U,U,U,U,O,O,U,U,U,O,R,U,U,O,L,L,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,O,R,O,U,U,U,O,D,D,D,D,D,D,O,D,D,D,D,D,D,D,D,O,R,U,O)`
+* `cpp MAIN.h -D STDIN=(U,U,U,U,U,U,U,U,U,U,F,R,U,U,U,U,U,U,U,R,U,U,U,U,U,U,U,U,U,U,R,U,U,U,R,U,L,L,L,L,D,B,R,U,U,O,R,U,O,U,U,U,U,U,U,U,O,O,U,U,U,O,R,U,U,O,L,L,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,O,R,O,U,U,U,O,D,D,D,D,D,D,O,D,D,D,D,D,D,D,D,O,R,U,O)`
Wait for about 30 seconds then the result should appear.
@@ -42,9 +41,4 @@ All work here can be considered licensed under BSD3 and you are welcome to use a
* Integers
* Characters/Strings
-
-Turing Machine
---------------
-
-I am also working on a Turing Machine in the CPP. This is coming soon...
-
+More details will be updated later...
Please sign in to comment.
Something went wrong with that request. Please try again.