thebotslam

How do I see what my bot's program is doing?

Logging

In Python, JavaScript, Lua, C++ and Java it's log, in C# Log, in BASIC LOG, and in Blocks the log block (assembly has LOG too, with its own format codes). Each {} in the text shows the next value as a number, and {|} shows it as a signal: | if true, . if not. In Python:

log("hull {} scan {|}{|}{|}{|}", chassis.hull, scanner.ping(0), scanner.ping(1), scanner.ping(2), scanner.ping(3))

That writes a line like hull 90 scan |.... The Reference under the editor has the exact form for your language, with examples for every part.

A few things to know:

Log the values your bot decides on: what it sees, where it thinks it is, which state it's in. When it does something odd, scrub the Arena's timeline to that moment and read what it was thinking.

In Brain code