Skip to content

Instantly share code, notes, and snippets.

@Taneb
Created October 18, 2014 21:49
Show Gist options
  • Save Taneb/ed9bb3db765d16bf6c3f to your computer and use it in GitHub Desktop.
Save Taneb/ed9bb3db765d16bf6c3f to your computer and use it in GitHub Desktop.
,[>+>+<<-] input digit and copy it into A(2) and A(3)
>>
[>,----------] input rest of line subtracting 10 from each character to check for EOL
++++++++++<[++++++++++<] re add the 10s
Note that this also adds 10s to the two copies of the digit and sets the location to the beginning of the tape
>---------------------------------------------------------- subtract 58 from the first copy of the digit so it is its number now
>----------< subtract 10 from the other copy of the digit so it is what it should be then go back to the first digit where the fun happens
[>[.>]<[<]>-] print the string then decrement the number until the number reaches zero
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment