On 5/9/08, Chris Shea <cmshea@[...].com> wrote:> I created another program for our Turning machines that reverses a> string of zeros and ones.
...
> I hope others share some.>
Here's a simple one.
$ cat add1.rb
#adds 1 to a binary number
seekLSB 1 seekLSB 1 R
seekLSB 0 seekLSB 0 R
seekLSB _ add1 _ L
add1 1 add1 0 L
add1 0 done 1 L
add1 _ done 1 L
$ruby turing.rb add1.rb 0
1
$ruby turing.rb add1.rb 1011
1100
-Adam