[gameprogrammer] RES: Re: XOR Problem

Thank you very much!!! It worked perfectly!!

-----Mensagem original-----
De: gameprogrammer-bounce@xxxxxxxxxxxxx
[mailto:gameprogrammer-bounce@xxxxxxxxxxxxx] Em nome de Dave Slutzkin
Enviada em: segunda-feira, 7 de maio de 2007 01:25
Para: gameprogrammer@xxxxxxxxxxxxx
Assunto: [gameprogrammer] Re: XOR Problem

On Sun, 6 May 2007 16:36:34 -0300, "Edilson Vasconcelos de Melo Junior"
<dirso@xxxxxxxxxxxxxxxxxx> said:
>             for (string::iterator i = Text.begin(); i != Text.end(); i++)
> 
>             {
> 
>                   letter = code | *i;

Shouldn't this line be:

letter = code ^ *i;

You still want to xor it to get it back to its original state, that's
the whole point.

Have a look at the attached one for a cleaned up version of your code.

Dave.
-- 
  Dave Slutzkin
  Melbourne, Australia
  daveslutzkin@xxxxxxxxxxx



---------------------
To unsubscribe go to http://gameprogrammer.com/mailinglist.html


Other related posts: