Tips for golfing in Turing Machine But Way Worse

3

1

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

MilkyWay90

Posted 2019-03-23T15:10:18.750

Reputation: 2 264

3Do enough people use this language for this post to be necessary? – Quintec – 2019-03-23T20:40:31.450

@Quintec Not really, but I will be using it in golfing a lot and I guess in the future other people may too – MilkyWay90 – 2019-03-23T21:45:55.137

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." – Shaggy – 2019-03-24T14:46:45.153

@Shaggy Right, I should probably change the "documentation" – MilkyWay90 – 2019-03-24T15:04:47.677

I will actually edit the documentation – MilkyWay90 – 2019-03-24T15:05:04.480

@Shaggy Okay, added documentation – MilkyWay90 – 2019-03-24T15:45:57.327

Answers

2

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.

MilkyWay90

Posted 2019-03-23T15:10:18.750

Reputation: 2 264