CODE YOUR
TROOPS TO VICTORY

Compete against other engineers in the Valley for World Domination.

At Box, we love to make businesses more productive through simple, friendly software. We also love to compete ruthlessly after-hours in Brisk, a Risk-inspired turn-based game.

The game is simple: devise the optimal strategy for your bot to take over the world. Come join us for a day-long tournament with the winner walking away with a $1,000 CASH GRAND PRIZE.

Since we expect competition to be fierce, we HIGHLY encourage you to get a head start by reading the docs and testing out your bot before 2/9!

 

When? Saturday, February 9th
11 am - 11 pm
Where? Box Headquarters
4440 El Camino Real
Los Altos, CA 94022



For questions, please email briskchallenge@box.com

SPOILS OF WAR

GRAND PRIZE
$1000 Cash Award
+ 5 Seat Box Account for Life



SECOND PRIZE
Beats Pro Headphones*
+ 5 Seat Box Account for Life

THIRD PRIZE
Playstation Vita*
+ 5 Seat Box Account for Life

FOURTH PRIZE
Parrot AR Drone*
+ 5 Seat Box Account for Life



RAFFLE
iPad Mini



BUG BOUNTIES
$50 Amazon Gift Cards


* or cash equivalent, if more than 1 player per team.


... and MORE!

SCHEDULE (TENTATIVE)

Saturday, February 9th

11:00 AM Registration
11:30 AM Introduction
12:00 PM Working lunch
12:00 PM Development, practice, bug bounties
04:00 PM Non-elimination round robin tournament
06:00 PM Dinner
07:00 PM Elimination round robin tournaments
09:00 PM Final tournament
10:30 PM Awards and wrap

FAQ

How much do I have to pay to participate?

Nothing! This competition is absolutely FREE.

Who can participate?

Anyone who has an interest in games and coding can participate. Some of the best bots we've seen are the least complex. So while complex AI algorithms might win the day, they aren't a necessity.

To compete, you will have to be physically present at Box HQ.

Do I need to have played Risk before?

No. Though it would help if you know the basics of the game. Read the wikipedia entry for Risk.

What else should I do to prepare?

In addition to reading the docs, it is highly recommended that you code up a practice bot in advance of the competition.

What do I need to bring to Box on the day of the challenge?

A laptop computer, charger, your bot, and, of course, yourself!

Are teams allowed?

Yes, though they are neither required nor necessary. If you compete as a team and your bot wins, the cash equivalent of the prize will be awarded to your team to split at your discretion.


For all other questions, please email briskchallenge@box.com

RULES

BASICS

The basic rules of Brisk are similar to popular board game Risk. There are some notable differences though to keep things interesting.

NUMBER OF PLAYERS

The Brisk Challenge server is currently configured for 2 player matches. You should also not hardcode in your player number – though in practice against the Brisk Challenge server you will always be player 1.

CARDS

These do not exist in the Brisk Gaming Challenge.

MAP

The basic map is similar to that found on Wikipedia. However it is not guaranteed to be exactly the same. Your code should use the game endpoint in the API to dynamically understand the current map as well as defined continents.

TRANSFERS AND FORTIFY

After a successful attack, you do have the option to transfer in additional armies to the new territory from the attacking one. This move must be made immediately after the successful attack.

After all attacks have been completed, you have the option to either end your turn explicitly or perform a single transfer from one territory to another. If you take the latter option, it will automatically end your turn after performing that action so there is no need for an explicit end turn event.

TECHNICAL DETAILS

Do write in any language of your choice. Provide us with details on how to run your bot on our servers if you win.

Do keep your client efficient. We have a short timeout set on a given turn. If it’s too short, let us know.

Don't borrow code from others. We’re interested in what you can do, not what you can find on the Internet.

Don't use any remote resource (e.g. RPC/web requests) other than briskchallenge.com.

Don't cheat/bend the rules/hack the server. Just don’t try. It is not in the spirit of this challenge.

DOCS

OVERVIEW

Brisk is based on popular games of military strategy. Each player battles to conquer the world by launching attacks, capturing territories, controlling continents and eliminating opponents.

GAME OBJECTIVES

Game objectives include capturing territories and eliminating opposing players. A player wins when all other players are eliminated.

GAME COMPONENTS

Map – A world map serves as the default game map.

Players – The Brisk Challenge server has several bots that can play Brisk. Box candidates write their own bots in order go head-to-head against the Box bots.

Territories – Players are assigned initial territories on the game map. As the game proceeds, players attempt to capture territories adjacent to the ones they own. Meanwhile, players defend their own territories from opponents’ attacks.

Continents – A group of related territories form a continent. Owning all of the territories in a continent allows a player to earn additional armies per turn.

Dice – An attacking player can roll a die for each army capable of attacking (up to 3 armies). A defending player can roll a die for each army that is defending (up to 2 armies).

Territory Bonuses – At the beginning of each player’s turn, that player earns armies based on the number of territories currently owned.

Continent Bonuses – At the beginning of each player’s turn, that player also earns armies based on the continents currently owned.

BRISK SERVERS

The Brisk Challenge server provides a RESTful API for interacting with the following resources:

In a RESTful API, clients interact with resources on the server via requests. All HTTP response bodies for JSON encoded.

JOINING A GAME

There are three ways to join a Brisk game (with example HTTP POST requests)...

1. Join a game against a Brisk Challenge bot (best way to debug/tune/practice with your bot).

POST /v1/brisk/game HTTP/1.1 {"join": true, "team_name": "Your team name here!"}

2. Start a game against another competitor's bot (best way to have fun).

POST /v1/brisk/game HTTP/1.1 {"join": true, "team_name": "Your team name here!", "token": 33j3jr3927r239h236923ydfd, "no_bot": true}

3. Join a game against another competitor's bot given a game identifier (will be used for the gaming competition).

POST /v1/brisk/game HTTP/1.1 {"join": true, "team_name": "Your team name here!", "token": 33j3jr3927r239h236923ydfd, "no_bot": true, "game": 1234}

where the following fields are provided in the HTTP body:

Example HTTP response:

HTTP/1.1 201 Created {"version": "v1", "service": "brisk", "game": 1234, "player": 2, "token": "aefd1a43161156cc4b0029c6883853c75b918fb7"}

where the following fields are present:

Once you have a valid game identifier, you can watch a game in progress or review a previous game by visiting: http://www.briskchallenge.com/v1/brisk/map.php

RETRIEVING THE GAME STATE

Example HTTP GET request to retrieve the game state of game ID 1234:

GET /v1/brisk/game/1234 HTTP/1.1

A successful HTTP response would look like:

HTTP/1.1 200 OK {"version": "v1", "service": "brisk", "game": 1234, "num_players": 2, "num_turns_taken": 23, "winner": "", "territories": [{"territory": 1, "player": 2, "num_armies": 3}, {"territory": 2, "player": 1, "num_armies": 3}, {"territory": 3, "player": 0, "num_armies": 3}, {"territory": 4, "player": 1, "num_armies": 3}]}

where the following fields are present:

RETRIEVING THE MAP LAYOUT

Example HTTP GET request to retrieve the map layout of game 1234:

GET /v1/brisk/game/1234?map=true HTTP/1.1

A successful HTTP response would look like:

HTTP/1.1 200 OK {"version": "v1", "service": "brisk", "game": 1234, "territories": [{"territory": 1, "territory_name": "Territory 1", "adjacent_territories":[2,3]}, {"territory": 2, "territory_name": "Territory 2", "adjacent_territories":[1]}, {"territory": 3, "territory_name": "Territory 3", "adjacent_territories":[1]}, {"territory": 4, "territory_name": "Territory 4", "adjacent_territories":[1]}], "continents":[{"continent":1, "continent_name":"Continent 1", "continent_bonus":5, "territories":[1,2,3,5,6,7,8,10]}, {"continent":2, "continent_name":"Continent 2", "continent_bonus":2, "territories":[9,13,14,15]}]}

where the following fields are present:

RETRIEVING THE MAP IMAGE

Example HTTP GET request to retrieve an SVG of the map for game 1234:

GET /v1/brisk/game/1234?map=svg HTTP/1.1

A successful HTTP response would look like:

HTTP/1.1 200 OK <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<svg> ... </svg>

CHECKING TURNS

Example HTTP GET request to check if it is player 1's turn in game 1234:

GET /v1/brisk/game/1234/player/1?check_turn=true HTTP/1.1

A successful HTTP response would look like:

The response would be similar to:

HTTP/1.1 200 OK {"version": "v1", "service": "brisk", "game": 1234, "player”: 1, "current_turn": false, "eliminated": false, "winner": null}

This returns a lite version of the current player status and includes the following fields:

RETRIEVING THE PLAYER STATE

Example HTTP GET request to retrieve the detailed player state of player 1 in game 1234:

GET /v1/brisk/game/1234/player/1 HTTP/1.1

A successful HTTP response would look like:

HTTP/1.1 200 OK {"version": "v1", "service": "brisk", "game": 1234, "player”: 1, "current_turn": false, "eliminated": false, "winner": null, "num_armies": 6, "num_reserves": 3, "territories": {{"territory": 2,"num_armies": 3}, {"territory": 4, "num_armies": 3}}}

and includes following fields:

RETRIEVING THE PLAYER STATE OF ALL PLAYERS IN GAME

Example HTTP GET request to retrieve the detailed player state of all players in game 1234:

GET /v1/brisk/game/1234/players HTTP/1.1
  • The response would be similar to:
  • HTTP/1.1 200 OK {"version": "1", "service": "brisk", "game": 1234, "players": [{"player": 1, "team_name": "laurent_continent_bot", "current_turn": true, "eliminated": false, "num_armies": 60, "turns_taken": 0, "num_reserves": 6, "num_territories": 20}, {"player": 2, "team_name": "lukes_father", "current_turn": false, "eliminated": false, "num_armies": 70, "turns_taken": 1, "num_reserves": 0, "num_territories": 22}]}

    where the following fields are present:

    PLACING ARMIES

    Example HTTP POST request for player 1 to place 2 armies on territory 32 in game 1234:

    POST /v1/brisk/game/1234/player/1/territory/32 HTTP/1.1 {"token": " aefd1a43161156cc4b0029c6883853c75b918fb7", "num_armies": 2}

    where the following fields are provided in the HTTP body:

    A successful HTTP response would look like:

    HTTP/1.1 200 OK

    LAUNCHING AN ATTACK

    Example HTTP POST request for player 1 to attack enemy territory 32 from territory 47 using 6 armies in game 1234:

    POST /v1/brisk/game/1234/player/1/territory/32 HTTP/1.1 {"token": " aefd1a43161156cc4b0029c6883853c75b918fb7", "num_armies": 6, “attacker”: 47}

    where the following fields are provided in the HTTP body:

    A successful HTTP response would look like:

    HTTP/1.1 200 OK {"version": "v1", "service": "brisk", "game": 1234, "player": 1, "attacker_territory: 32, "defender_territory: 24, "attacker_dice": [6,4,1], "defender_dice": [6,3], "attacker_losses": 1, "defender_losses": 1, "defender_territory_captured": false, "attacker_territory_armies_left": 5, "defender_territory_armies_left": 1}

    where the following fields are present:

    TRANFERRING ARMIES

    Example HTTP POST request for player 1 to transfer 2 armies from territory 32 to territory 47 in game 1234:

    POST /v1/brisk/game/1234/player/1/territory/32 HTTP/1.1 {"token": "befd1a43161156cc4b0029c6883853c75b918fb7", "num_armies": 2, "destination": 47}

    where the following fields are provided in the HTTP body:

    A successful HTTP response would look like:

    HTTP/1.1 200 OK

    ENDING A TURN (if the turn didn't auto-end)

    Example HTTP POST request to end the turn of player 1 in game 1234:

    POST /v1/brisk/game/1234/player/1 HTTP/1.1 {"token": "befd1a43161156cc4b0029c6883853c75b918fb7", "end_turn": true}

    where the following fields are provided in the HTTP body:

    The response would be similar to:

    HTTP/1.1 200 OK

    RETURN CODES AND ERRORS

    As a result of a successfully processed request, the Box Coding Challenge server returns HTTP status code 200:

    HTTP/1.1 200 OK

    Or HTTP status code 201:

    HTTP/1.1 201 Created

    In situations where an error has been encountered, the Box Coding Challenge server returns standard HTTP status codes as well. A malformed request will result in HTTP status code 400:

    HTTP/1.1 400 Bad Request {"error_msg": "Bad Request"}

    An attempt to access a Brisk resource illegally will result in HTTP status code 401:

    HTTP/1.1 401 Unauthorized {"error_msg": "Unauthorized"}

    An attempt to access a non-existent Brisk resource will result in HTTP status code 404:

    HTTP/1.1 404 Not Found {"error_msg": "Not Found"}

    APIs

    Language bindings are available for Java, PHP, Python, and Ruby.