3
\$\begingroup\$

What are some tips for golfing in Turing Machine But Way Worse, a language made by MilkyWay90 and ASCII-only?

Tips should be Turing Machine But Way Worse-specific and not be trivial (For examples that you shouldn't post, removing unnecessary whitespace or using shorter state names).

EDIT: Added documentation to TMBWW

\$\endgroup\$
6
  • 4
    \$\begingroup\$ Do enough people use this language for this post to be necessary? \$\endgroup\$
    – Quintec
    Commented Mar 23, 2019 at 20:40
  • \$\begingroup\$ @Quintec Not really, but I will be using it in golfing a lot and I guess in the future other people may too \$\endgroup\$
    – MilkyWay90
    Commented Mar 23, 2019 at 21:45
  • \$\begingroup\$ Not with a comment like this, they won't: "I am way too lazy to put documentation here, so just look at the code and learn Python 3." \$\endgroup\$
    – Shaggy
    Commented Mar 24, 2019 at 14:46
  • \$\begingroup\$ @Shaggy Right, I should probably change the "documentation" \$\endgroup\$
    – MilkyWay90
    Commented Mar 24, 2019 at 15:04
  • \$\begingroup\$ I will actually edit the documentation \$\endgroup\$
    – MilkyWay90
    Commented Mar 24, 2019 at 15:05

1 Answer 1

3
\$\begingroup\$

Use the negative tape

For code-golf questions where you need to process input, it is easier to move onto the negative tape to push a bit to the tape instead of having to travel to the end of the input on the positive tape (and sometimes that way may even be impossible when you need to support NUL bytes).

For example, when you need to push to the tape and you have input, going on the negative tape would be much shorter than having to go to the end of the input.

0 0 0 0 1 0 0
1 0 1 0 1 0 0
0 1 0 0 2 1 1

would be much shorter than

0 0 0 1 1 0 0
1 0 1 1 0 0 0
0 1 0 1 2 0 0
1 1 1 1 0 0 0
0 2 0 1 3 0 0
1 2 1 1 0 0 0
0 3 0 1 4 0 0
1 3 1 1 0 0 0
0 4 0 1 5 0 0
1 4 1 1 0 0 0
0 5 0 1 6 0 0
1 5 1 1 0 0 0
0 6 0 1 7 0 0
1 6 1 1 0 0 0
0 7 0 1 8 0 0
1 7 1 1 0 0 0
0 8 0 0 9 0 0
0 9 1 0 a 1 1

and the second solution doesn't even work with NUL bytes.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.