Documentation
Java
Java
Overview
The version of Java supported is Java OpenJDK 14.0.1
Each turn your source code will be compiled within a new sandbox, by default no information is shared or persisted between turns, if you wish to persist data then you should use the User Data field within the API.
Input - Standard Input (STDIN)
Within Java you can use InputStreamReader
to capture the STDIN input
String inputString, outputString; BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); try { inputString = br.readLine(); } catch (IOException ioe) { System.out.println(ioe); }
Ouput - Standard Outout (STDOUT)
Within Java you can simply use System.out.println()
to return your CSV based instructions to BotWars.
System.out.println("5:5-M-N,12:12-D");
Example Bot
import java.io.*; public class Main { public static void main (String[] args) { String inputString, outputString; BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); try { inputString = br.readLine(); } catch (IOException ioe) { System.out.println(ioe); } // Bot Logic... System.out.println("5:5-M-N,12:12-D"); } }