brainfmt (2014)

2014–04–24

« Esoteric programming languages

c = brainfmt
c 
c brainfmt is a dialect of the popular language Brainfuck with a strict
c formatting rule enabling large scale development under enterprise concerns
c Every valid Brainfuck program is a valid brainfmt program given:
c 
c * The file contains no TAB (ASCII 9) characters
c 
c * No line is longer than 80 characters
c 
c * Characters other than brainfuck commands (ie comments) must be placed on
c   their own line starting with the letters "c " and indented
c   appropriately
c 
c * One space before opening brackets unless their are on the first column
c
c * Closing brackets are on their own line
c 
c * The lines end after opening brackets dots or periods
c 
c * Every line is indented using spaces only using the Fermat number
c   (ie a prime of the form $2^(2^n))+1$) corresponding to the
c   indentation level
c   This means the outer block is indented 0 spaces
c   the first block 3 spaces
c   the next 5
c   the next one 17
c   and so on
c 
c * There must be the same amount of + and - in the source code
c 
c This specification doubles as a hello world program
c Writing a quine or a brainfmt checker in brainfmt is left as an
c exercise for the reader
c
c You can use any Brainfuck implementation to run brainfmt

+++++++ [
   >+>++>+++>++++>+++++>++++++>+++++++>++++++++>+++++++++>++++++++++>+++++++++++
   >++++++++++++>+++++++++++++>++++++++++++++>+++++++++++++++>++++++++++++++++
   <<<<<<<<<<<<<<<<-
]
>>>>>>>>>.
<<<<<<<<<>>>>>>>>>>>>>---.
+++<<<<<<<<<<<<<>>>>>>>>>>>>>>----.
++++<<<<<<<<<<<<<<>>>>>>>>>>>>>>----.
++++<<<<<<<<<<<<<<>>>>>>>>>>>>>>-.
+<<<<<<<<<<<<<<>>>>.<<<<>>>>>>>>>>>>>>>-.
+<<<<<<<<<<<<<<<>>>>>>>>>>>>>>-.
+<<<<<<<<<<<<<<>>>>>>>>>>>>>>++.
--<<<<<<<<<<<<<<>>>>>>>>>>>>>>----.
++++<<<<<<<<<<<<<<>>>>>>>>>>>>>----.
++++<<<<<<<<<<<<<>>>>+.
-<<<<.
--------------------------------------------------------------------------------
------------------------------------------------------------