Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Poor APRS Code
alt0=0;
alt1=0;
alt2=0;
alt3=0;
alt4=0;
alt5=0;
d=getch();
c=0;
if (d!='-') do {
alt5=alt4;
alt4=alt3;
alt3=alt2;
alt2=alt1;
alt1=alt0;
t=(d-'0')*33;
while (t > 99) {
t-=100;
alt1++;
if (alt1 > 9) {
alt1-=10;
alt2++;
if (alt2 > 9) {
alt2-=10;
alt3++;
if (alt3 > 9) {
alt3-=10;
alt4++;
if (alt4 > 9)
alt4-=10;
alt5++;
}
}
}
}
alt0=(t/10)+c;
if (alt0 > 9) {
alt0-=10;
alt1++;
if (alt1 > 9) {
alt1-=10;
alt2++;
if (alt2 > 9) {
alt2-=10;
alt3++;
if (alt3 > 9) {
alt3-=10;
alt4++;
if (alt4 > 9) {
alt4-=10;
alt5++;
}
}
}
}
}
c=t;
while (c > 9)
c-=10;
d=getch();
} while (d!=',' && d!='.');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment