zmxv / bf2d Goto Github PK
View Code? Open in Web Editor NEWBrainfuck to D conversion utility
Brainfuck to D conversion utility
bf2d is a Brainfuck to D conversion tool written in the D programming language. I wrote it on a boring Sunday evening in 2005 and ended up winning the first obfuscated D coding contest. Original README: Brainfuck is a minimalistic Turing-complete programming language, designed by Urban Müller around 1993. A Brainfuck program has an implicit pointer, which is free to move around and manipulate an array of 30000 integers, initially all set to zero. The pointer initially points to the leftmost element of this array. There are eight Brainfuck instructions, represented by a single character respectively. > move the pointer to the next element to the right < move the pointer to the next element to the left + increment the value at the pointer. - decrement the value at the pointer. . read the value at the pointer and write it to the standard output. , read a character from the standard input and store its value in the element at the pointer. [ pass control to the next instruction following the matching ] if the value at the pointer is zero. ] pass control to the next instruction following the matching [ if the value at the pointer is zero. Other characters in a Brainfuck program are considered as comment and ignored by a compiler or interpreter. Here is a simple "Hello D!" program in Brainfuck: >+++++++++[<++++++++>-]<.>+++++++[<++++>-]<+.+++++++..+++.>>+++++++ +[<++++>-]<.>+++++++[<+++++>-]<+.>>++++++++[<++++>-]<+.>++++++++++. Don't have a Brainfuck compiler? Fret not. Run BF2D to convert your BF programs to clean D source code on the fly! It's also a perfect tool for D neophytes who have a BF background. Build instruction (Win32): dmd bf2d.d Usage: bf2d < %brainfuck-source% > %converted-D-source% Some more BF programs for readers to play with: ,+[-.,+] an echo program that copies input to output >,+[->,+]<[.<] reverse the input >>>+>>>>>+>>+>>+[<<],+[--[-[-[-[-[-[-[-[<+>-[>+<-[>-<-[-[-[<++ [<++++++>-]<[>>[-<]<[>]<-]>>[<+>-[<->[-]]]]]]]]]]]]]]]]<[-<<[- ]+>]<<[>>>>>>+<<<<<<-]>[>]>>>>>>>+>[<+[>+++++++++<-[>-<-]++>[< +++++++>-[<->-]+[+>>>>>>]]<[>+<-]>[>>>>>++>[-]]+<]>[-<<<<<<]>> >>],+]+<++>>>[[+++++>>>>>>]<+>+[[<++++++++>-]<.<<<<<]>>>>>>>>] yet another word count program, slightly modified from Daniel B Cristofani's version (http://www.hevanet.com/cristofd/brainfuck/)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.