ROTA
Fight off a series of attacks. In the Colosseum. Alone.
How to play
The ancient Roman game of ROTA is easy to learn, quick to play. It makes a great game for new recruits that teaches planning ahead and the points of the compass.
No one knows the Roman name for it, but scholars call it ROTA, Latin for “wheel.” ROTA boards were painted, scratched or scribbled everywhere that Romans went. It probably kept a lot of bored Roman soldiers busy.
Scholars guess that ROTA is a three-in-a-row game like tic-tac-toe. They have reconstructed the rules based on medieval games that look a lot like it. There is one key difference between tic-tac-toe and ROTA…. ROTA can never end in a tie.
When you complete this challenge, send your resume along with the hash value you collected and any code used in the challenge to: careers@praetorian.com
How to play
I’ll explain how to play the game, then you’ll get a chance to experience the real game.
Set-Up For a Game of ROTA (2 players)
- First, draw a circle. Draw a plus sign in it [+] and then an [X].
- Draw dots at the end of each line and in the middle where they cross.
- Now you’ll need pieces (different colors for each player).
- Each player gets THREE pieces.
The Rules for the Game of ROTA
- Each turn, players can put one piece on the board in any open spot.
- After all three pieces are on the board, a player must move one piece each turn.
- A piece may move along any line or curving edge of the circle to the next empty spot.
- A piece may not jump other pieces nor move more than one spot.
- The first person to get three in a row wins.*
The challenge
https://rota.praetorian.com/rota/service/play.php
- The game starts out when the player sends a request for a new game.
- The game session between the player and computer begins as soon as request is made.
- The objective is to play 50 consecutive games against the computer. Each game must be at least thirty-moves. The placement of a piece is not considered a move. Remember, a hash will be sent in the data response field. Make sure you stay on the lookout for this value and keep it safe.
- Giant switch statements are cumbersome and discouraged. You are an engineer. We believe you can come up with something a bit more sophisticated.
- Please send a copy of your resume along with all the hash values you have collected and any code used in the challenges to: careers@praetorian.com
Note: Successful requests (the correct use of placing a piece or moving a piece) must be made within a certain time limit or the session time restarts and a new game must be requested
Request Values
request
values to tell the computer what you want to do, for example:
https://rota.praetorian.com/rota/service/play.php?request=new
Use the following parameters as reference when interacting with the web service: Name | Description |
---|---|
|
Restart a game. In doing so you will create a new game and restart the timer for game length. This request can be made at any point. You must include your email in the initial request to obtain a valid session. Example: https://rota.praetorian.com/rota/service/play.php?request=new&email=rota@example.org |
|
Place a new piece on the board. This request can only be made during the first three moves of each player’s turns. Use the Example: https://rota.praetorian.com/rota/service/play.php?request=place&location=3 |
|
Use the Example: https://rota.praetorian.com/rota/service/play.php?request=move&from=3&to=4 |
|
Returns the current status of the session which includes board status, computer wins, and player wins. This request can be made at any time, but does not reset the timer between successful requests. Example: https://rota.praetorian.com/rota/service/play.php?request=status |
|
Increases the Example: https://rota.praetorian.com/rota/service/play.php?request=next |
Return Values
All web service responses are in a JSON format. Every server response will include the updated game board with the computer’s next move if the prior request involved a player move.
Name | Description |
---|---|
|
Specifies whether the request was successfully executed. If the request did not go through it will fail and an explanation is given in the response data. A success is returned if the request does go through and is properly executed Success: Fail: |
|
Contains the responses data which may include: |
The board layout
The board will be returned as a string, where each position corresponds to a position on the board. Board positioning is as below, where each position has a number 1-9.
- represents an empty space
- represents a space occupied by a computer piece
- represents a space occupied by a player piece
Starter Code
To help get you started, we’ve included basic Ruby code needed to interact with and solve this challenges.
Python
Will you be next? We’ll be watching.
But feel free to reach out via Twitter @PraetorianLabs.