Hacker News new | past | comments | ask | show | jobs | submit login

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.



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: