DuckFuck v0.2: D-based FuckFuck and More! (Such as BrainFuck)

Nick Sabalausky a at a.a
Mon Jan 16 22:13:37 PST 2012


(I've put far too much effort into this... ;) )

Introducing DuckFuck: ( http://bitbucket.org/Abscissa/duckfuck )

A flexible, modular D-based interpreter/conversion system for FuckFuck and 
other BrainFuck-based langauges. Includes the DuckFucker: A command-line 
tool to interpret any supported langauge.

Currently supported:

Languages:
    - brainfuck: http://esoteric.voxelperfect.net/wiki/Brainfuck
    - fuckfuck:
        http://esoteric.voxelperfect.net/wiki/Fuckfuck
        http://web.archive.org/web/20050318095341/http://www.chilliwilli.co.uk/ff/

Backends:
    - Compile time conversion to D
    - Runtime Interpreter

Sample usage:
---------------------------------------------
// Hello World! Interpreted brainfuck at runtime.
brainfuck("
    This is a basic hello world in brainfuck
    >+++++++++[<++++++++>-]<.>+++++++[<++++>-]<+.+++++++..+++.>>>++++++++[<++++>-]
    <.>>>++++++++++[<+++++++++>-]<---.<<<<.+++.------.--------.>>+.
    Neat huh?
");
writeln();

// Echo. Converted from fuckfuck to D at compile-time.
auto echoThis = "Echo this!";
mixin(fuckfuck!(echoThis, null, "
    /* This is 'echo' in fuckfuck */
    knob  /* read input to current tape cell */
    ARSE
            /* Inside the loop */
            COCKKNOB  /* write output at current tape cell, read input */
    B U T T  /* repeat until current tape cell is \x00 (ie, end of file - 
automatically sent when input string is exhausted) */
"));

or:

$duckfucker hello.bf
Hello World!
$duckfucker echo.ff < input.txt > output.txt
---------------------------------------------

Input and output can be from (mix and match!):
    - stdin/stdout (default)
    - named array
    - generator/sink function

Homepage: http://bitbucket.org/Abscissa/duckfuck
More detailed information: 
https://bitbucket.org/Abscissa/duckfuck/src/master/README.txt




More information about the Digitalmars-d-announce mailing list