1.0.0-alpha.0 • Published 3 years ago

playfulbot-client v1.0.0-alpha.0

Weekly downloads
-
License
AGPL-3.0-only
Repository
github
Last release
3 years ago

Playfulbot Client

This library enables you to program a bot in javascript or typescript and let it play in a tournament on playfulbot.com.

Example

import { PlayfulBot, BotAI, GameAction, GameState } from 'playfulbot-client';

const token = 'Token copied from playfulbot website.' 

export class MyAI implements BotAI<GameState> {

  run(gameState: GameState, playerNumber: number): GameAction {
    return // action
  }
}

const bot = new PlayfulBot<WallRaceGameState>(token, new MyAI());

bot.run().catch((reason) => {
  console.error(reason);
  process.exit(1);
})