Re: APGAR cipher to C#/VB.Net [message #369026 is a reply to message #368997] |
Mon, 26 January 2009 14:09 |
|
halo2pac
Messages: 659 Registered: December 2006 Location: Near Cleveland, Ohio
Karma:
|
Colonel |
|
|
CarrierII wrote on Mon, 26 January 2009 09:30 | First you missed the ./ off the end of the string U. It needs to be 64 characters long.
|
thought that was some sort of Perl escape thingy.
CarrierII wrote on Mon, 26 January 2009 09:30 | Second, the "7 - i" should have read "8 - i" like in the original Perl.
Third, the "8-$i" in the original Perl points to the null terminator when $i is zero (for a string s that is 8 characters long, s[8] returns the null terminator). So Asc(8-i) when i = 0 needs to return 0, as in my revised version.
|
ya I was wondering why there was an 8. (this is why im not coding my stuff in perl :S)
CarrierII wrote on Mon, 26 January 2009 09:30 | Fourth, a small optimization: since we only ever get to this line
temp = Asc(a) << (Asc(a) And 1) And Asc(v(7 - i))
if Asc(a) And 1 = 1, I replaced the former by the latter.
|
beautiful! I think I tried that at some point (i didnt paste all 600 attempts :S) but I screwed up on other areas.
CarrierII wrote on Mon, 26 January 2009 09:30 | I tested it on some of the strings in your table and it looks to be working.
|
IT WORKS!
CarrierII wrote on Mon, 26 January 2009 09:30 | Hope that helps
|
Immensely.
CarrierII wrote on Mon, 26 January 2009 09:30 | CarrierII's brother (ahydra)
|
Well thank you very much ahydra.
This has to be the toughest thing I have ever attempted to code.
Also thanks much to the following people who helped me and aca20031:
Roshambo
Zack
Dave
Ghostshaw
... I hope I am not forgetting anyone.. if i am... pm me and I will thank you xD
Rene-Buddy | Renegade X
Join the fight against Obsessive-Compulsive Posting Disorder. Cancel is ur friend.
*Renegade X Dev Team Member*
[Updated on: Mon, 26 January 2009 14:12] Report message to a moderator
|
|
|