[Rails] Re: the ^ and % operators in context

2012-02-06 Thread John Merlino
This is not actually a piece of code I would use, but rather something from a book thats a mental exercise. On Feb 4, 7:20 pm, Robert Walker li...@ruby-forum.com wrote: John Merlino wrote in post #1044105: The % is modulus (remainder)operatorand ^ is bitwise. In this context, we take a file,

[Rails] Re: the ^ and % operators in context

2012-02-04 Thread Robert Walker
John Merlino wrote in post #1044105: The % is modulus (remainder) operator and ^ is bitwise. In this context, we take a file, and go through each character and encrypt it. But why are the ^ and % operators used here: def encrypt(reader, writer) key_index = 0 while not reader.eof?