Can we debug the code with hero.say in new multiplayer like Mages Might?

A great application of experimenting to see if it works! In this case, hero.say does not appear to function in Mages’ Might. This is where each language’s native logging function comes in.

console.log is JavaScript’s standard way of logging information, print is the standard for python.

CodeCombat provides both functions for both languages, but it’s probably best to stick to the language specific output — most interpreters do not. I have not tested either function in other languages on CodeCombat.

The output will be sent to the browser’s console (there are plenty of online resources to help you find it), and will unfortunately be buried among plenty of other messages, but the information is there.

Keep in mind to prevent console spam CodeCombat will limit the number of debug messages to 200; if it does so, you will see the message “Log limit 200 reached; shutting up.”

console.log("My debug message")
print("My debug message")

4 Likes