Problem 33 Parity Control

Back to Problem Solutions forum

MontBlanc     2015-08-15 16:44:24

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.

Rodion (admin)     2015-08-15 20:41:12
User avatar

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".

MontBlanc     2015-08-15 20:57:35

Hello :P
You mean if the sum of bits of the encoded-binary is odd it's corrupted ?

Rodion (admin)     2015-08-16 05:49:42
User avatar

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! :)

MontBlanc     2015-08-16 06:23:18

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)
Please login and solve 5 problems to be able to post at forum