There Once was a Fish Named Fred

From Esolang
Jump to navigation Jump to search

There Once was a Fish Named Fred is a programming language similar to brainfuck, except there are seven commands, "there", "once", "was", "a", "fish", "named", and, finally, "Fred." This language was created by User:Star651 on December 23, 2011. There are spaces between the commands/words when programming. As you can see, there is no command that is like the , in BF.

Command BF equivalent
there <
once >
was +
a -
fish .
named [
Fred ]

Hello world

was was was was was was was was named once was was was was named once was was once was was was once was was was once was there there there there a Fred once was once was once a once once was named there Fred there a Fred once once fish once a a a fish was was was was was was was fish fish was was was fish once once fish there a fish there fish was was was fish a a a a a a fish a a a a a a a a fish once once was fish once was was fish

This is the example taken from brainfuck, converted into There Once was a Fish Named Fred.

JavaScript Fred-to-brainfuck converter

function fredToBrainfuck(code) {
    code = (code + " ").replace(/there /g, "<").replace(/once /g, ">").replace(/was /g, "+").replace(/a /g, "-").replace(/fish /g, ".").replace(/named /g, "[").replace(/Fred /g, "]");
    return code;
}