3 ms·
This is very cool. It's amazing how "simple" something can be and still be Turing-complete. Also slightly shorter: while word[S:]: pIndex, word = (pIndex +
by dbaupp 14y ago
This is very cool. It's amazing how "simple" something can be and still be Turing-complete.
Also slightly shorter:
while word[S:]: pIndex, word = (pIndex + 1) % len(C), word[1:] + C[pIndex] * (word[0] == "1")
Or, even shorter,
while word[S:]: pIndex, word = (pIndex + 1) % len(C), word[1:] + C[pIndex] * int(word[0])
And obviously one can just use one letter variable names/remove whitespace.