This is a Java client (bot) for the Jass challenge server. This client allows you to easily develop a bot for the Jass challenge.
https://github.com/webplatformz/challenge/wiki
If you are an enrolled student in switzerland, you are welcome to participate the JassChallenge2017 competition in April '17
https://jass-challenge.zuehlke.io/
Clone this repository and start (gradlew run
) the Application class:
public class Application {
//CHALLENGE2017: Set your bot name
private static final String BOT_NAME = "awesomeJavaBot";
//CHALLENGE2017: Set your own strategy
private static final RandomJassStrategy STRATEGY = new RandomJassStrategy();
private static final String LOCAL_URL = "ws://localhost:3000";
public static void main(String[] args) throws Exception {
String websocketUrl = parseWebsocketUrlOrDefault(args);
Player myLocalPlayer = new Player(BOT_NAME, STRATEGY);
startGame(websocketUrl, myLocalPlayer, SessionType.TOURNAMENT);
}
}
The client needs the challenge server to connect to. Clone the challenge server and run npm start. For more information go to Jass challenge server repository.
To implement your own bot you need to provide an implementation of the JassStrategy interface:
public interface JassStrategy {
Mode chooseTrumpf(Set<Card> availableCards, GameSession session);
Card chooseCard(Set<Card> availableCards, GameSession session);
default void onSessionStarted(GameSession session) {}
default void onGameStarted(GameSession session) {}
default void onMoveMade(Move move, GameSession session) {}
default void onGameFinished() {}
default void onSessionFinished() {}
}
To test your bot against other bots, such das the random bot, you need to start your own tournament.
- start the challenge server:
npm start
- Browse to http://localhosthost:3000
- Enter some user name:
4. Enter some tournament name and press Enter
- Join your bots, they should appear on the next page
- Join random strategy bots for testing. In your challenge server directory enter the command:
npm run bot:start
This will add 4 random bot teams to your tournament.
Thanks to fluescher for creating this skeleton.