Menu

Certain Methods in BattleRules Are Not Compiling

millsmess
2020-02-14
2020-02-17
  • millsmess

    millsmess - 2020-02-14

    Hi all,

    I've been trying to use the method getBattlefieldWidth() and the method getBattlefieldHeight(). However, when I use either my code refuses to compile. I get an error that looks like this:

    C:\robocode\robots\DE\Cypress.java:32: error: cannot find symbol
    getBattlefieldWidth();
    ^
    symbol: method getBattlefieldWidth()
    location: class Cypress

    This is especially confusing as I can succesfully compile when using other methods from BattleRules, like getGunCoolingRate() and getNumRounds().

    Any thoughts appreciated.

    EDIT:
    Some more details on my system:
    -I'm using Robocode 1.9.3.7 on Windows 10 with an up-to-date version of Java
    -I'm compiling using this command:
    javac -classpath libs\robocode.jar C:\robocode\robots\DE\Cypress.java

    I get the same behaviour when setting up the compiler from inside the Robocode editor with the following classpath options:
    -classpath "C:\Program Files\Java\jre1.8.0_201/lib/rt.jar";libs\robocode.jar

     

    Last edit: millsmess 2020-02-14
  • Flemming N. Larsen

    Sorry for the late answer.

    The name of the method you are looking for is speeled with a big letter F:

    getBattleFieldWidth()

    Sorry for the confusion.

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.