Saturday, October 17, 2015

Codingame - fun way to hone your programming skills

Some time ago a friend show me a webpage where you can polish you coding skills while having fun!

There are a lot of sites that offer programming tasks / exercises. Usually you get the instructions and when you have prepared the solution then you can upload it as a source file. It is then tested and at the end you are provided with the information about the results of you program (if it work as it should or if it does not work).

The main advantages of CodinGame site are:
  • number of languages accepted (23),
  • online editor with autocomplete function and three styles (e.g. Vim / Emacs),
  • well defined tasks with a lot of well-thought out test cases,
  • the ability to debug your program round by round,
  • fancy and nice looking graphics and animation (I know that it is not the most important part, but it makes solving the task more appealing, especially to begginers) alongside console output to help with the debug process,
  • achievements ;)
You can visit the site by clicking the image below:


The site offers few types of competition:
  • single player puzzles,
  • multi player,
  • optimization,
  • online clashes,
  • live contests.
Today I will focus on the first type - single player puzzles. This is the oldest feature of the site and there are 52 puzzles with different difficulty levels. On each of the level you get the task description, which states what the program has to do alongside with detailed information about  the input that is provided and the output expected. Usually some initial information is given at the beginning and then the puzzles are played in turn-by-turn way - you are given current state and have to provide the output - your action. For each task there are well defined test cases that starts with very simple ones, that can often be passed with simple, naive solution. Each test is more and more difficult and checks your program against different input data (edge cases) or tests performance of your code (so that you use something more refined than bruteforce solutions). In addition to this some of the puzzles has graphic animations of what is happening so it feels like you are playing a game and in the end you even get achievements! What is even better - it can land you a job!

 All in all I can wholeheartedly recommend the CodinGame website for both the advanced programmers and to beginners. Great way to improve coding skills while having fun!

Also you can find my solutions on my github:

https://github.com/Michal-Fularz/codingame_solutions

at the moment I have all easy puzzles done in Python (2.7.x). Some others (medium / contest /clash of code) are work in progress. Please take into account that I am learning Python language currently. If you find errors or non-pythonic code let me now. I would like to improve my Python skills as I enjoy the language a lot. 


TL; DR

CodinGame is a webpage with coding puzzles done right - they are interesting and fun to do. Also you get achievements on your way and can even get a job!