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

   The instruction sets are the remaining lines, formatted like >C.I:WMN
   C current instruction name.
   I the input from the current tape position. Either 0 or 1. Each instruction has 
   execution parameters for both inputs.
   W the output to be written to the tape at the current position. Either 0 or 1.
   M the movement of the read/write head. A 0 moves the head one position to the 
   left. A 1 moves it to the right.
   N the name of the next instruction to be executed at the new tape position.
Would it have been clearer to use "<" or ">" to specify whether to move left/right from the current position?



As it's structured, that wouldn't work. To move, it replaces the leading zero of the tape with:

  * If the movement is "0": "00"
  * If the movement is "1": ""
The choice of 1 to move right is arbitrary (but makes sense to match the 0), it could be any other symbol, but the 0 is needed to because that's what's prepended to the tape.

Someone could probably find a way around it, but it would likely make it harder to understand.




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

Search: