Pascal Bot Questions

Hi @GeelKanarie; @Malman

I am creating a Sample bot for the Free Pascal / Delphi language suite. I have a Console App that does nothing except echoing ‘Hello World. I am robot’ to the console for now, but when I run it via the Gaming Framework (tower-defence-runner-1.0.1.jar), I get the following NullPointerException:

D:\2018-TowerDefence-master\starter-pack>java -jar tower-defence-runner-1.0.1.jar
java.lang.NullPointerException
at za.co.entelect.challenge.botrunners.BotRunnerFactory.createBotRunner(BotRunnerFactory.java:8)
at za.co.entelect.challenge.bootstrapper.GameBootstrapper.parsePlayer(GameBootstrapper.java:97)
at za.co.entelect.challenge.bootstrapper.GameBootstrapper.prepareGame(GameBootstrapper.java:86)
at za.co.entelect.challenge.bootstrapper.GameBootstrapper.main(GameBootstrapper.java:41)

Any ideas as to the possible reason?

Sorry, answering my own stupid question after ooking at the Game code. Suppose it will be resolved once I submit the new BOT.

The ClassFactory that executes the custom code looks as follow:

public class BotRunnerFactory {
public static BotRunner createBotRunner(BotMetaData botMetaData, int timeoutInMilliseconds) throws InvalidRunnerState {
switch (botMetaData.getBotLanguage()){
case JAVA:
return new JavaBotRunner(botMetaData, timeoutInMilliseconds);
case CSHARPCORE:
return new CSharpCoreBotRunner(botMetaData, timeoutInMilliseconds);
case JAVASCRIPT:
return new JavaScriptBotRunner(botMetaData, timeoutInMilliseconds);
case RUST:
return new RustBotRunner(botMetaData, timeoutInMilliseconds);
case CPLUSPLUS:
return new CPlusPlusBotRunner(botMetaData, timeoutInMilliseconds);
case PYTHON2:
return new Python2BotRunner(botMetaData, timeoutInMilliseconds);
case PYTHON3:
return new Python3BotRunner(botMetaData, timeoutInMilliseconds);
case KOTLIN:
return new KotlinBotRunner(botMetaData, timeoutInMilliseconds);
case CPLUSPLUS
return new CPlusPlusBotRunner(botMetaData, timeoutInMilliseconds);
default:
break;
}
throw new InvalidRunnerState(“Invalid bot language”);
}
}

The main issue is that the following code is missing:
case PASCAL
return new PascalBotRunner(botMetaData, timeoutInMilliseconds);

with PascalBotRunnerexactly exactly the same as CPlusPlusBotRunner.

c",)

Hi @Larez

You will need to provide the bot runner as a pull request to https://github.com/EntelectChallenge/2018-TowerDefence
With this, and a readme of how to compile and run a pascal bot on windows, we can look into adding the bot as a new language

Hi @pierre.roux,

I have already created the pascal starter bot code, bot.json, build.bat and readme.md files and is trying to figure out how to submit them. Do I just add them to the GitHub repository mentioned?

Please advise or direct me to a document that describes this process.
Thank you for your assistance

PS: Should I change/update the Java Class Factory code as well?

c",)

Hi @pierre.roux

The pascal starter bot is finally submitted and it almost took me longer to figure out how GitHub works, than to write the BOT.

Thank you for your advice.

c",)

1 Like