Originally published on 08/09/2015 by Aude, updated on 17/09/2018.

It’s been three years now since Clash of Code has been released as a new way to have fun while programming. Clash of Code is a multiplayer mode where you can challenge your friends in short real-time coding battles. Here below is everything you should know about this mode.

Clash of Code logo

Clash of Code, in Short

A Very Quick Code Combat

The maximum time allowed for a Clash is 15 minutes, but most of them can be finished in under 5 minutes. It’s not rare to end a Clash in less than a minute. Perfect for a quick pause at work!

Some advice to get better at Clash of Code:

  • Skim through the statement and scan the example. Usually, it’s enough to know what you have to do. If it’s not, read the statement carefully until you understand the exercise.
  • Don’t bother with good practices. It’s a game, not a code quality competition. Code dirty.
  • Relax! Don’t be stressed: it’s just a game after all. What if you’re last? Who cares? With practice, you’ll eventually improve.

3 Types of Clash of Code

When you start a clash, the type of clash is chosen randomly between these three types:

  1. Fastest: easy, you just have to be the first to pass all the tests*
  2. Shortest: code golf! Pass all the tests* with the minimum amount of characters. Ruby, Python, and JavaScript are your new friends.
  3. Reverse: the statement is hidden; only test cases (input + expected output) are given. You should guess what to do. The fastest to pass the tests* wins.

*As with every game on CodinGame, after you submit your code, only validators (test cases very close to the IDE test cases) count.

How to play Clash of Code

A Game for the Community by the Community

Clash of Code exercises are now created by the community. Anyone can propose a concept of Clash in the contribute section of CodinGame. It will then be reviewed and validated — if the exercise meets basic quality criteria — by experienced players of the community.

Clash of Code Bots

Countering Cheating Issues

More than a year ago, as a measure to avoid bots in Clash of Code, we added a Captcha that is displayed to players who start a lot of Clashes for a short amount of time.

I understand it can be frustrating to play against people who manage to complete a Clash in less than 20 seconds, but there is most likely no cheating involved.

  • Either those players are very good Clash of Code players. After a bit of practice, everyone can get used to these short battles and learn useful tricks and formula.
  • Or they already played the same Clash and remembered how to solve it. The amount of Clashes is not infinite and some players play a lot.
  • Or the Clash played was very simple. A lot of Clash exercises can be solved in 1 line of code.

There are bots on Clash of Code though.

Ours.

CodinGame Official Bots

Wuuuuut??!

Let me explain.

A few months ago, we realized that a lot of players couldn’t play much at specific times during the day (around 12 am GMT for example). Waiting for 5 minutes in the lobby because you can’t find any opponents is quite discouraging. Fewer players in Clash of Code because of few players: it’s a vicious circle.

So we designed bots with predefined levels to mimic players’ behavior. During a Clash, the bots copy a previous submission (code and duration) of a real player according to their level. Put simply, a bot with a high level will copy a random previous submission taken randomly in the top submissions for that Clash. There are bots of all levels but the probability of encountering a medium-level bot is higher.

Our bots can’t create or start a Clash but they gradually join a Clash until there are 4 players in the lobby, then they leave to make room for more real players. We design them to encourage people to play; if there are enough players around, they simply don’t play at all.

Slack Bot

We have developed a bot for Clash of Code on Slack for those, like us, using it at work.

It’s quite simple: it enables you to launch a Clash directly from Slack so that your co-workers can join it. Besides the Slack integration, which is nice, there are two special features the official Clash of Code section doesn’t provide:

  • A private leaderboard (on Slack only)
  • The ability to choose the type of Clash and the language

For more information about how to use it, check this out and install the bot from this page.

Clash of code artwork

Clash of Code Live Events

Earlier this year, we organized two mini-tournaments of Clash of Code at Onepoint and Talent.io in Paris. Clash of Code is already fun to play, but I can tell you, it’s even more fun to play it live with people.

Fred and I were thrilled to attend the two evenings and play with the CodinGamers who came. The two companies welcomed us in amazing venues and provided some snacks and drinks to keep our brains working!

More than the competition itself, we really enjoyed coding together for fun. There were, of course, some prizes for the winners (we had a private leaderboard).

Being able to talk to other passionate developers was a really rewarding experience to me. I learned a lot of interesting things at the tournament. It showed CodinGame isn’t just an online platform; it’s a huge community of developers who share their knowledge together.

EISTIMaxou

I’ve spent a great evening with developers as friendly as they’re talented in the Talent.io premises. Thanks a lot to them for their welcome. Thanks also to CodinGame for organizing this Clash of Code event, hoping to see you again soon. Finally, a big thank to my codemate Pierre-Henri for joining me; the more we are, the more we code ^^.

Romuald_78

Another table of Clash players at Talent.io

A room full of Clashers 😍

Amazing venue at Onepoint to play Clash of Code

A few minutes before the competition started

View on the Eiffel Tower with CodinGamers at Onepoint

Amazing view of the Eiffel Tower from Onepoint’s terrace

If you’re interested in hosting your own Clash of Code tournament in your company, don’t hesitate to contact us here!


Play Clash of Code