Thursday, April 29, 2010

Stupid coding tricks.

In a fit of distraction one day, this was the most ridiculous "solution" for converting a test score to a letter grade I could muster.
public static char S2G(int s) {
return (char)(1249078710>>s/10*3&7|64);
}

DailyWTF-worthy, I say.

No comments:

Post a Comment