Skip to main content
deleted 436 characters in body
Source Link
ბიმო
  • 16.9k
  • 2
  • 41
  • 104

Self-modifying Brainfuck, score 16

twasbrilligandtheslithytovesdidgyreandgimbleinthewabeallmimsyweretheborogovesandthemomerathsoutgrabebeware␀The Jabberwock␀my<[<<]>[.>]>>.

Try it online!

Explanation

Initially the tape is set up like this:

$$ \begin{aligned} & \dots\ \texttt{␀}\ \texttt{T}\ \texttt{h}\ \texttt{e}\ \texttt{␠}\ \texttt{J}\ \texttt{a}\ \texttt{b}\ \texttt{b}\ \texttt{e}\ \texttt{r}\ \texttt{w}\ \texttt{o}\ \texttt{c}\ \texttt{k}\ \texttt{␀}\ \texttt{m}\ \texttt{y}\ \texttt{<}\ \texttt{[}\ \texttt{<}\ \texttt{<}\ \texttt{]}\ \texttt{>}\ \texttt{[}\ \texttt{.}\ \texttt{>}\ \texttt{]}\ \texttt{>}\ \texttt{>}\ \texttt{.}\ & \texttt{␀}\ \texttt{␀}\ \dots \\ & \dots\ \texttt{ }\ \texttt{ }\ \texttt{ }\ \texttt{ }\ \texttt{ }\ \texttt{ }\ \texttt{ }\ \texttt{ }\ \texttt{ }\ \texttt{ }\ \texttt{ }\ \texttt{ }\ \texttt{ }\ \texttt{ }\ \texttt{ }\ \texttt{ }\ \texttt{ }\ \texttt{ }\ \texttt{ }\ \texttt{ }\ \texttt{ }\ \texttt{ }\ \texttt{ }\ \texttt{ }\ \texttt{ }\ \texttt{ }\ \texttt{ }\ \texttt{ }\ \texttt{ }\ \texttt{ }\ \texttt{ }\ & \texttt{^}\ \texttt{ }\ \dots \end{aligned} $$$$ \begin{aligned} \dots\ \texttt{␀}\ \texttt{T}\ \texttt{h}\ \texttt{e}\ \texttt{␠}\ \texttt{J}\ \texttt{a}\ \texttt{b}\ \texttt{b}\ \texttt{e}\ \texttt{r}\ \texttt{w}\ \texttt{o}\ \texttt{c}\ \texttt{k}\ \texttt{␀}\ \texttt{m}\ \texttt{y}\ \texttt{<}\ \texttt{[}\ \texttt{<}\ \texttt{<}\ \texttt{]}\ \texttt{>}\ \texttt{[}\ \texttt{.}\ \texttt{>}\ \texttt{]}\ \texttt{>}\ \texttt{>}\ \texttt{.}\ & \texttt{␀}\ \texttt{␀}\ \dots \\ & \uparrow \end{aligned} $$

Since we want to move to the beginning of the string we use <[<<] such that we jump over the first \$\texttt{␀}\$ character.

Now we can just move to the \$\texttt{T}\$ with > and print the whole string with [.>] and since we picked the substring where the next \$\texttt{y}\$ is not far, we can just jump to it directely and print it with >>..

Self-modifying Brainfuck, score 16

twasbrilligandtheslithytovesdidgyreandgimbleinthewabeallmimsyweretheborogovesandthemomerathsoutgrabebeware␀The Jabberwock␀my<[<<]>[.>]>>.

Try it online!

Explanation

Initially the tape is set up like this:

$$ \begin{aligned} & \dots\ \texttt{␀}\ \texttt{T}\ \texttt{h}\ \texttt{e}\ \texttt{␠}\ \texttt{J}\ \texttt{a}\ \texttt{b}\ \texttt{b}\ \texttt{e}\ \texttt{r}\ \texttt{w}\ \texttt{o}\ \texttt{c}\ \texttt{k}\ \texttt{␀}\ \texttt{m}\ \texttt{y}\ \texttt{<}\ \texttt{[}\ \texttt{<}\ \texttt{<}\ \texttt{]}\ \texttt{>}\ \texttt{[}\ \texttt{.}\ \texttt{>}\ \texttt{]}\ \texttt{>}\ \texttt{>}\ \texttt{.}\ & \texttt{␀}\ \texttt{␀}\ \dots \\ & \dots\ \texttt{ }\ \texttt{ }\ \texttt{ }\ \texttt{ }\ \texttt{ }\ \texttt{ }\ \texttt{ }\ \texttt{ }\ \texttt{ }\ \texttt{ }\ \texttt{ }\ \texttt{ }\ \texttt{ }\ \texttt{ }\ \texttt{ }\ \texttt{ }\ \texttt{ }\ \texttt{ }\ \texttt{ }\ \texttt{ }\ \texttt{ }\ \texttt{ }\ \texttt{ }\ \texttt{ }\ \texttt{ }\ \texttt{ }\ \texttt{ }\ \texttt{ }\ \texttt{ }\ \texttt{ }\ \texttt{ }\ & \texttt{^}\ \texttt{ }\ \dots \end{aligned} $$

Since we want to move to the beginning of the string we use <[<<] such that we jump over the first \$\texttt{␀}\$ character.

Now we can just move to the \$\texttt{T}\$ with > and print the whole string with [.>] and since we picked the substring where the next \$\texttt{y}\$ is not far, we can just jump to it directely and print it with >>..

Self-modifying Brainfuck, score 16

twasbrilligandtheslithytovesdidgyreandgimbleinthewabeallmimsyweretheborogovesandthemomerathsoutgrabebeware␀The Jabberwock␀my<[<<]>[.>]>>.

Try it online!

Explanation

Initially the tape is set up like this:

$$ \begin{aligned} \dots\ \texttt{␀}\ \texttt{T}\ \texttt{h}\ \texttt{e}\ \texttt{␠}\ \texttt{J}\ \texttt{a}\ \texttt{b}\ \texttt{b}\ \texttt{e}\ \texttt{r}\ \texttt{w}\ \texttt{o}\ \texttt{c}\ \texttt{k}\ \texttt{␀}\ \texttt{m}\ \texttt{y}\ \texttt{<}\ \texttt{[}\ \texttt{<}\ \texttt{<}\ \texttt{]}\ \texttt{>}\ \texttt{[}\ \texttt{.}\ \texttt{>}\ \texttt{]}\ \texttt{>}\ \texttt{>}\ \texttt{.}\ & \texttt{␀}\ \texttt{␀}\ \dots \\ & \uparrow \end{aligned} $$

Since we want to move to the beginning of the string we use <[<<] such that we jump over the first \$\texttt{␀}\$ character.

Now we can just move to the \$\texttt{T}\$ with > and print the whole string with [.>] and since we picked the substring where the next \$\texttt{y}\$ is not far, we can just jump to it directely and print it with >>..

Source Link
ბიმო
  • 16.9k
  • 2
  • 41
  • 104

Self-modifying Brainfuck, score 16

twasbrilligandtheslithytovesdidgyreandgimbleinthewabeallmimsyweretheborogovesandthemomerathsoutgrabebeware␀The Jabberwock␀my<[<<]>[.>]>>.

Try it online!

Explanation

Initially the tape is set up like this:

$$ \begin{aligned} & \dots\ \texttt{␀}\ \texttt{T}\ \texttt{h}\ \texttt{e}\ \texttt{␠}\ \texttt{J}\ \texttt{a}\ \texttt{b}\ \texttt{b}\ \texttt{e}\ \texttt{r}\ \texttt{w}\ \texttt{o}\ \texttt{c}\ \texttt{k}\ \texttt{␀}\ \texttt{m}\ \texttt{y}\ \texttt{<}\ \texttt{[}\ \texttt{<}\ \texttt{<}\ \texttt{]}\ \texttt{>}\ \texttt{[}\ \texttt{.}\ \texttt{>}\ \texttt{]}\ \texttt{>}\ \texttt{>}\ \texttt{.}\ & \texttt{␀}\ \texttt{␀}\ \dots \\ & \dots\ \texttt{ }\ \texttt{ }\ \texttt{ }\ \texttt{ }\ \texttt{ }\ \texttt{ }\ \texttt{ }\ \texttt{ }\ \texttt{ }\ \texttt{ }\ \texttt{ }\ \texttt{ }\ \texttt{ }\ \texttt{ }\ \texttt{ }\ \texttt{ }\ \texttt{ }\ \texttt{ }\ \texttt{ }\ \texttt{ }\ \texttt{ }\ \texttt{ }\ \texttt{ }\ \texttt{ }\ \texttt{ }\ \texttt{ }\ \texttt{ }\ \texttt{ }\ \texttt{ }\ \texttt{ }\ \texttt{ }\ & \texttt{^}\ \texttt{ }\ \dots \end{aligned} $$

Since we want to move to the beginning of the string we use <[<<] such that we jump over the first \$\texttt{␀}\$ character.

Now we can just move to the \$\texttt{T}\$ with > and print the whole string with [.>] and since we picked the substring where the next \$\texttt{y}\$ is not far, we can just jump to it directely and print it with >>..