The best kittens, technology, and video games blog in the world.

Thursday, March 26, 2015

How to get to codewars top 100

Miyako wearing chanchanko by Takashi from flickr (CC-SA)

Codewars is a fun site with simple programming exercises. The kind of stuff you can do over lunch if you've seen all the let's plays on youtube already. (oh and that here is obviously referral URL I'll be getting worthless internet points for if you use it, what did you think...)

As is fashionable these days, they implemented point system, and even top 100 ranking. Of course inevitable consequence of gamification is that someone is going to write a walkthrough on how to minmax the shit out of it.

By the way you can cheat quite easily by googling answers or creating sockpuppet account, unlocking everything on it (which forfeits eligibility to get points), and copy&pasting answers to your main account, but I'm talking about getting to top 100 legitimately.

Scoring system

There are points for creating your own problems, having forum comments upvoted etc., but that's just way too much work, and it takes forever until it gets approved and you receive points you need, so let's ignore it.

The point system is basically:

  • 8/7 kyu - 1 point
  • 6/5 kyu - 2 points
  • 4/3 kyu - 5 points
  • 2/1 kyu - 10 points
  • any beta - 2 points extra
They claim to have dan rank katas (for 20 points each) as well, but I don't think they ever actually implemented any.

How to score high

It might seem that you should focus on hard problems, but that's not good at all. They don't require more skill - they are mostly just much longer to code. Like writing simple SQL engine or some genetic algorithm matching 3 page spec.  Ignore them completely.

There's also tempting "Next Kata" button, but it makes weird selections, so don't do it, go to kata search page and pick what you want yourself.

But first, choose your languages. The correct choices are the following, assuming you know them at all, even at hello world level:
  • Ruby - easy language, ton of Ruby-only katas
  • Python - easy language, ton of Python-only katas
  • Coffeescript - that's actually important, there's a lot of JS/CS only katas
The traps you should disable are:
  • Javascript - don't bother, almost all Javascript katas have coffeescript version too (if not Ruby/Python version), so why do the more tedious version
  • Haskell / Clojure - if you're really good at them, it's much harder to half-ass them than with Ruby, Python, or Coffeescript, you don't have IDE or REPL to help you, and they have few katas
  • Java/C# - don't even think about it, they take forever, verbosity vomit will spoil your lunch, and they added them recently so there are very few katas for them
So first, pick your favourite language, search for some approved katas in that language, sort by easiest, and do some 8/7 kyus. It's hardly worth any points, but you need to get familiar with the interface, and many are ridiculously easy. It's same reason you have to do tutorials in every single Call of Duty game ever.

Now it's a good idea to do a few harder katas to just get some idea what they are, but don't spend too much time on that.

And now the big trick - change search from "approved" to "beta". Easiest first. You can go through tons of trivial betas, for 3-4 points each, much faster than it would take to do hard katas legitimately.

Now some of beta katas suck, but there's number of upvotes/downvotes just under every kata title, so if it's negative, ignore it and go to the next one.

Currently 1063 points are needed to get to top 100, that's a bit over 300 easy betas. You can easily do 15+ over one casual lunch, so you'll be in top 100 if you make that a habit for a few weeks!

Final hints

If kata turns out surprisingly difficult, or somehow seems buggy, just next it and try something else.

It's faster to open 10 katas in new tabs than using browser back button, in case you couldn't figure it out on your own yet.

And it's not said anywhere, but if you solved kata in one language, you get no extra points for solving it in another. That's a shame, as it would be the easiest way to get ridiculous amounts of points even faster.

Good luck, code warrior!

1 comment:

Chucky P said...

Thank you very much. Very useful!