Skip to content
This repository has been archived by the owner on May 3, 2024. It is now read-only.

Latest commit

 

History

History
92 lines (73 loc) · 1.78 KB

README.md

File metadata and controls

92 lines (73 loc) · 1.78 KB

Robocode

Install

Download GitHub Repository

git clone --recursive https://github.com/eskopp/Robocode.git

Install RoboCode

I recommend that you install Robocode in the following directory.

  • Windows
    C:\robocode
  • Linux / Ubuntu
    /usr/games/robocode

Java Code

Basic Project

The project does not need a main function, so it can be a bit complicated to build artifacts in different interpreters.

  • Example
import robocode.*;

public class MyBot extends Robot {

    // The run method is called when the battle starts
    public void run() {
         // ...
    }

}

Build Class file

cd Niffler 
javac -cp robocode.jar Niffler.java

Install Bot

  • Ubuntu folder:
    ~/.robocode/robots
  • Windows folder:
    C:\robocode\robots

Windows Workflow

  • Window:
    @echo off
    cd Niffler
    javac -cp robocode.jar Niffler.java 
    copy /Y Niffler.class ../Niffler.class
    :: Basic installation
    copy /Y Niffler.class C:\robocode\robots\Niffler.class
  • Linux:
        cd Niffler
        javac -cp robocode.jar Niffler.java 
        cp Niffler.class ../Niffler.class
        cp Niffler.class ~/.robocode/robots/

Robocode

New Battle

New-Battle

Battle

Battle

History