Back to Problem Solutions forum
The introduction states that 'corrupted bytes' should be removed. What does that mean exactly ?
I have already done the traduction but I have all the corrupted bytes with it.
Hi! This means that the bytes for which parity check fails should not be copied to output.
In the example given with the problem statement that leads to disappearing one of the letters
(n
) so that "Anna" becomes "Ana".
Hello :P
You mean if the sum of bits of the encoded-binary is odd it's corrupted ?
Yes, exactly this! It looks like problem statement lacks precise definition of "corrupted" so I will add some phrase about it right now - thanks for this hint! :)
Thank you very much, it worked perfectly. I mean, I could have checked, took me two lines and I had my doubts...
But the more precise the better, I agree.
While you're at it, could you tell me if you see anything wrong with my code ? Task #74 Clock Hands.
I use basically the same formula for minutes and hours, yet minutes are 100% correct and hours are off!
http://i.imgur.com/ZuoI1Ma.png
Here's my code :
heure=data[i][0]+data[i][1]
heure=int(heure)
heure=rad((heure%12)/12*360)
minutes=data[i][3]+data[i][4]
minutes=int(minutes)
minutes=rad(minutes/60*360)
X_heure=a+R_heure*cos(heure)
Y_heure=a+R_heure*sin(heure)
X_minutes=a+R_minutes*cos(minutes)
Y_minutes=a+R_minutes*sin(minutes)