Welcome to (easy) Artificial Intelligence Programming

Loick Michard
Machine Intelligence Report
4 min readDec 16, 2015

According to Schalkoff, R.J. (1990), artificial intelligence is “A field of study that seeks to explain and emulate intelligent behaviour in terms of computational processes”. Today, there is an increasing number of fields where AI is useful such as robotics, machine learning, computer vision, etc.

Agents

One common technical approach to AI is the concept of rational agent [Russell & Norvig, 2003]. An agent is a program that evolves in a specific environment, can perceive through sensors and act through actors. It takes decisions with its knowledge of the environment, rationally.

Simple representation of how an agent works

Environments

Each environment has its own characteristics. The most common are:

  • Known vs Unknown: whether or not you know something about how the environment will react. For example, a newborn child evolves in an unknown environment, he has to discover it before (that’s why he tries absolutely everything).
  • Accessible vs Inaccessible: agents have access or not to all environment variables that could be used for decision. For exemple, when playing poker one doesn’t know the other players’ cards. Except for cheaters or Rain Man, it’s an inaccessible environment.
  • Deterministic vs Non-deterministic: the behaviour of the environment is defined logically vs statistically. When playing chess, an action will always have the same given consequences (deterministic). For a moving robot, its motors’ behaviour is uncertain (non-deterministic).
  • Static vs Dynamic: whether or not the environment is changing while an agent is taking a decision. For a self driving car, someone can appear on the road while the car is thinking about what to do next. It’s a dynamic environment.
  • Discrete vs Continuous: finite vs infinite number of possible actions for an agent.

It’s really important when designing an agent to know what kind of environment you are dealing with. It will guide you and help you avoid common mistakes. Be sure to fully understand your environment before writing a single line of code.

CodinGame & A.I.

Artificial Intelligence programming is probably one of the most thrilling aspects of coding, though the field still remains relatively confidential.

From experience I find that we learn better by practicing a lot (and even better, when practice is fun). However, the process of creating an AI agent is complex because you have to simulate the environment first (like every rules of a chess game). All the communication between the environment and the agents (actors and sensors) should be specified. It quickly becomes overkill.

If you wish to practice AI coding, CodinGame has designed a system that enables developers to focus on the intelligent core of an agent. It simplifies the process of moving from learning to practice. CodinGame tackles the issue on providing an easy-to-use and adapted development environment, with everything useful to discover — and improve — your AI coding skills. Finally, because everyone needs to share their awesome results, a graphical output of the environment is provided.

CodinGame online IDE

The CodinGame agent

Communication with the environment (actors and sensors) is simulated using standard input/output stream. An agent can modify the environment by printing some actions to the standard output stream. The agent can access all its sensors by reading on the standard input stream.

Default code for a Python agent on CodinGame

CodinGame removes the programming language barrier by offering over 20 programming languages on the platform.

The CodinGame environment

CodinGame’s abstract architecture is able to handle all possible kinds of environments. The behaviour of each environment is handled by the platform. Each coder has access to a complete description on how the environment reacts.

For each game, the agents are opposed in numerous situations. A leaderboard is then created using the TrueSkill algorithm. It allows everyone to benchmark their AI performance and to be automatically ranked according to others.

A graphical representation for each game is available to visualize the environment. It makes debugging easier and coding really exciting!

Game leaderboard

Examples

CodinGame has 2 main categories of AI games:

Future

My work at CodinGame is to always create new types of content and games for programmers. I like to imagine what coding will become in the next few years.

We would like to create more of these games to cover all kind of environments (non-deterministic, unknown, …). Therefore, we are open to any new ideas: please help us build the future of AI programming!

Learn more about AI

--

--