thebotslam

Can I use feet and pounds instead of metres and kilograms?

There are two separate settings: how the page shows values to you, and which units each of your programs works in.

How values are shown

This setting changes the numbers you read on the page: part stats in the Factory, distances, speeds, masses and so on.

The game itself works in metric. Code in the editor is never rewritten.

Which units a program works in

A program says its units in a comment near its top, in its own language. In Python:

# units: imperial

In JavaScript, C++, Java and C# it's // units: imperial; in Lua -- units: imperial; in BASIC ' units: imperial; and in assembly ; units: imperial. A program without that line is metric.

The game then speaks to each program in its own units. In an imperial program, lengths such as a rangefinder's distance or a GPS position come in feet (and areas in square feet). Angles, times, hull points and counts are the same in both.

Switching a program's units

The button above the editor, next to Start from…, shows metric or imperial. Click it to switch:

  1. Brain code changes the program's units line, or adds one at the top.
  2. It marks the lines whose numbers look like lengths, and tells you which ones to check. For example, a 15 meant as metres needs to become about 49 in feet.
  3. It never changes those numbers for you, so check each marked line.

A new blank program from Start from… comes in the units you've chosen to see values in. House bot programs are written in metric.

When a program is imperial, the Reference under the editor gives its values in feet too.