When we first started the OMGWTF2 contest, one thing that we hoped to make clear in our FAQ was that we really only wanted submitters to do his or her best on their entry's UI. After all, this is a coding competition not an art contest.

However, if you were a special developer who could weave together a abomination of a solution and make it look extra pretty, well, we felt that combination deserved special recognition and thus, the "Lipstick on a Pig" prize was born. The recipient? Randolpho and his entry: "Ask Threepio"

(Click for a full sized view. Really, you want to do this.)

So, how'd he pull off this feat of beauty? Randolpho explained that aside from the starry background image (borrowed from starlogs.net) and the Threepio & Friend images "[t]here are no layout images in this UI. No images for rounded corners or custom text format. Nada. All layout, typography and animation is accomplished via strict HTML5 and CSS3. The theme was clearly inspired by Star Wars, and features a jukebox with Star Wars music for the user to listen to while asking C-3PO a question. The UI is intended to be quirky and humorous -- this is most evident in the randomly chosen friend to whom C-3PO selects to pass your question. The main user interaction is asking C-3PO a question and watching the animated responses. The UI was designed for use by any browser that supports HTML5 and CSS3."

So, it looks good, it's well written, C-3PO has "friends" to help him out, and it has a freaking jukebox! But...Where's TRWTF? The REAL WTF? That answer dear reader lies with how the yes/no answer is determined.

Remember, C-3PO is a protocol droid who is fluent in "over 6 million forms of communication" but, lacking an actual protocol droid on the back-end of his submission, or any of C-3PO's friends, Randolpho went after the next best thing - Google Translate.

His solution works a lot like the game "Telephone" or "Chinese Whispers" where one person whispers something to another person and that person passes it on and so on, but to make it interesting, he cycles through a shuffled list of several dozen different languages with translations of the question between each.

The idea for this is definitely clever, but you might be thinking, "Hold on! Google limits the number of requests that a developer key can process in a given day! Wouldn't a few decision requests push that key's usage count over the edge?" and you'd be absolutely correct. However, Randolpho hatched a plan to sidestep around this limitation.

"The hardest part was getting around my lack of a Google API key. Why would I do that? Well, I wanted to fire off about 70 translations per user decision request, and a developer key is limited to, what, a hundred per day? That would hardly do for testing, now would it? I also planned to cloud host this, so I didn't want any old person sucking up translations, did I? So, it had to be a screen-scrape or nothing. That turned out to be easier than I thought -- as long as I have a session cookie from Google, I can hit their unpublished API all day long and they don't seem to care. I'll probably get a Cease and Desist at some point, but for now it works."

But how does it reach that FINAL yes/no decision? Well, the answer may surprise you.

namespace Ask3po.Web.Controllers
{
  public class DecisionController : ApiController
  {
    public HttpResponseMessage GetDecision()
    {
      var question = Request.GetQueryNameValuePairs().Where(q => q.Key == "q").Select(q => q.Value).FirstOrDefault();
      if (question == null) return Request.CreateResponse(HttpStatusCode.BadRequest, "Bad Request");
      var translator = new WhisperTranslator();
      var translation = translator.Whisper(question);
      var hash = translation.GetHashCode();
      var yes = hash % 2 == 0;
      return Request.CreateResponse(HttpStatusCode.OK, new Decision()
      {
        IsYes = yes,
        Translation = translation
      });
    }
  }
}

Yep - after all that - it comes down to whether the hash code of the returned translation is odd or even. So, despite an attractive UI, no amount of novelty can counter the ugly, terrible thing that lurks under the surface. Congratulations Randolpho - your lipsticked pig has truly earned its just reward.

[Advertisement] BuildMaster allows you to create a self-service release management platform that allows different teams to manage their applications. Explore how!