thebotslam

Which programming languages can I write my bot's brain in?

Picking a language

  1. Open Brain code and pick your bot.
  2. Click + file to start a new program for it.
  3. Choose a language in the League list above the editor.
  4. Use Start from… to load a template: Blank (every part already set up, with an empty loop) or a house bot written in that language.

Each language is its own league. On the League ladder, bots are only rated against bots in the same language.

What each one is like

LeagueWhat it isFile
Assemblythe bot CPU's own instructions.s
C++ (Arduino)Arduino style: setup() once, then loop() once a tick.ino
BASICclassic line-numbered BASIC.bas
Pythona subset of Python 3.py
JavaScripta subset of JavaScript.js
Luaa subset of Lua.lua
Javaa class that extends Bot.java
C#a Unity-style class (: Bot) with Start() and Update().cs
BlocksScratch-style blocks you snap together.blocks

Every language except assembly is a subset. The syntax is the real language's, but only the parts that make sense on a tiny robot CPU are kept.

The same command in each language

Every language talks to the same parts. Here is "drive forward at full throttle":

Python, JavaScript, Lua:  chassis.forward = 1
C++:                      chassis.forward(1);
Java:                     chassis.setForward(1);
C#:                       chassis.Forward = 1;
BASIC:                    DRIVE 1

In Blocks it's the drive block. In assembly you write the chassis's throttle register yourself.

Where to find what a language can do

Open Reference under the editor. It lists every part, its commands and readings, and the language's own rules, all written for the language you picked, with examples.